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

What is the easiest way to globally enable optional .env.local in Docker Compose? #12585

Open
0x131315 opened this issue Feb 25, 2025 · 1 comment

Comments

@0x131315
Copy link

In Makefile i use this way:

include .env
-include .env.local
-include local.mk
export

//other code

What is the easiest way to GLOBALLY enable OPTIONAL .env.local in Docker Compose?

In issues and official docs i have found the following options, but they are not simple:

  • env_file - support optional files, but not globally, requires too many edits when there are a lot of services
  • COMPOSE_ENV_FILES - globally, but does not support optional files

I use Docker Compose version 2.32.4

@ndeloof
Copy link
Contributor

ndeloof commented Feb 26, 2025

There's no such mechanism offered by Docker Compose.
.env is the sole supported source to define variables to be applied for interpolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants