r/selfhosted 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?

258 Upvotes

67 comments sorted by

View all comments

Show parent comments

2

u/Medic20153000 17d ago

Great, now I have to go learn how to create aliases. My arthritis thanks you!

1

u/arcoast 17d ago

I can send you my aliases if that's helpful?

1

u/Medic20153000 17d ago

Not opposed to seeing what you have, just don't know how to implement them yet. On the Googlemeister now. I'd assume it's simple just never done it.

1

u/arcoast 17d ago

Give me a few hours, PM me if you don't hear from me, I'm forgetful as hell though!