ARTICLE / DEV COMMUNITY
Did you know docker-compose only takes environment variables from`.env` only?
June 11, 2023 1 min read 0 reactions 2 comments #discuss #docker #compose #env
Recently I have encountered an issue with docker compose. I have separated the environment files and declared todocker-compose.yaml like following,
env_file:
- .dev_env
When I ran docker compose up, it was not working on the compose itself but the container. because of environment variables. Then I found following solution for this.
docker compose --env-file .dev_env --env-file .prod_env up