Open inakimalerba opened 2 days ago
env_file
set in includes file is used to process interpolation (i.e replace ${VARIABLE}
in yaml), not to set environment values. As includes
parse another compose file to be added to your compose application, while interpolation takes place, the local environment is the one you run locally
There's unfortunately a major misconception in compose between variables used by interpolation and environment variables. I hardly can imagine a way we could support this use-case, need to think twice about this.
Description
I'm trying to include a compose file into my main compose which contains a secret defined on it's own environment file, but compose fails to resolve it.
The main compose includes a child compose which has a secret loaded on it's own .env file.
When moving
app/.env
to.env
it works fine, which means include is not respectingproject_directory
norenv_file
for the secret resolving.Is there any way I can avoid this besides copying the
.env
to the root or adding the--env-file app/.env
flag to thedocker compose up
command? (which also works)Steps To Reproduce
The project structure is as follows:
docker-compose.yml
app/docker-compose.yml
app/.env
When trying to run the previous stack, I get the following error:
Compose Version
Docker Environment
Anything else?
No response