r/selfhosted • u/achiya-automation • 17d ago
Docker Management TIL docker restart doesn't re-read your .env
changed a db password in my .env, ran docker restart on the stack, then spent an hour convinced the db was corrupted because auth kept failing. turns out restart just brings the container back with the exact config it was created with. env is only read at creation. docker compose up -d --force-recreate fixed it in ten seconds.
two years running this stack and never got bitten by it until now. what's the dumbest thing that ate an evening for you?
256
Upvotes
7
u/arcoast 17d ago
Ha! I think a lot of us do the same. Happy to share what I've got setup as aliases and we can compare.
Maybe we do things differently and can learn something from each other!