Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple .env files #12255

Open
gitshelmi opened this issue Oct 30, 2024 · 1 comment
Open

Support for multiple .env files #12255

gitshelmi opened this issue Oct 30, 2024 · 1 comment
Labels
area/env .env and env_file kind/feature

Comments

@gitshelmi
Copy link

Description

I would like to request a feature enhancement for Docker Compose. In our large project, we've broken down the architecture into multiple docker-compose.yml files located in different directories. We've encountered an issue where we cannot have multiple .env files to provide parameters using the ${} syntax within these docker-compose.yml files.

Currently, Docker Compose looks for a single .env file in the directory where the command is executed, which limits our ability to manage environment variables for each compose file separately when they are in different paths. It would be highly beneficial if Docker Compose could support multiple .env files located in different directories, allowing each docker-compose.yml file to access its corresponding .env file regardless of the execution path.

This feature would greatly enhance the modularity and scalability of large projects by enabling better organization of environment variables across multiple compose files and directories.

Thank you for considering this request.

@jhrotko
Copy link
Contributor

jhrotko commented Oct 31, 2024

Hello @gitshelmi !

I was wondering why using env_file does not support your current use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/env .env and env_file kind/feature
Projects
None yet
Development

No branches or pull requests

2 participants