As we discovered last night, the Django container wasn't getting the environment variables. It turns out the PostgreSQL container wasn't either.
For some reason, docker-compose isn't picking up the environment variable settings from ./bin/.env even though the docker-compose.yml file specifies that in an env_file directive. If you take the directive out and move .env where the docker-compose.yml file is, it works., So that's what I'm doing.
I have a long-standing policy of not troubleshooting commercial products like Docker - if the default works, I use it. The Best Practices Fairy isn't going to take away any of our wishes if we just put .env where docker-compose.yml expects it. ;-)
As we discovered last night, the Django container wasn't getting the environment variables. It turns out the PostgreSQL container wasn't either.
For some reason,
docker-compose
isn't picking up the environment variable settings from./bin/.env
even though thedocker-compose.yml
file specifies that in anenv_file
directive. If you take the directive out and move.env
where thedocker-compose.yml
file is, it works., So that's what I'm doing.I have a long-standing policy of not troubleshooting commercial products like Docker - if the default works, I use it. The Best Practices Fairy isn't going to take away any of our wishes if we just put
.env
wheredocker-compose.yml
expects it. ;-)