Open lukeorland opened 8 years ago
The .env file at the root of the repo has special use: https://docs.docker.com/compose/env-file/
The file is sourced when docker-compose is invoked, and the values affect docker-compose commands.
My suggestion is to move the contents of the current .env file to docker-compose*.yml, under a new environment: heading.
environment:
For reference: https://docs.docker.com/compose/compose-file/#/environment
Would this PR address it? https://github.com/realpython/dockerizing-django/pull/37
I was looking in more elegant way not using .env file but there is no good way to do it without duplicating vars :(.
The .env file at the root of the repo has special use: https://docs.docker.com/compose/env-file/
The file is sourced when docker-compose is invoked, and the values affect docker-compose commands.
My suggestion is to move the contents of the current .env file to docker-compose*.yml, under a new
environment:
heading.For reference: https://docs.docker.com/compose/compose-file/#/environment