env_file, environment and .env only work on the current working directory #1867
Closed
jolly-jump
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ok this is hard to explain: I wanted to integrate the docker-compose into my greater docker-compose containing an nginx-reverse-proxy and more...
Normally this works out of the box, this time I stumbled across the usage of env_file and the
.env
-file:My conclusion is: I have to put the .env file where the docker-compose file is, and I cannot do the following:
The problem is not that I cannot rename the
.env
-file or put it in a sub-directory which I usually do. The containers still get the env-variables set.The problem is, that the replacement in the docker-compose file then does not take place anymore.
Although this here suggest, that you could do what I wanted,
The last bit just does not work: If i put the env_file to point to some other file, the TAGS get not replaced in the docker-compose.yml.
The SA-Answer here explains what I experience, while the other answers there seem to miss the point.
My point for the installation is:
env_file
and use the values in.env
to replace variables in the docker-compose since they serve different purposes..env
-file serves only the purpose for the containers, not for the docker-compose file and can be moved and renamed however one wants.Just in case, someone tries the same like me :)
Beta Was this translation helpful? Give feedback.
All reactions