-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Support multiple .env files #7326
Copy link
Copy link
Closed
Labels
Description
It's pretty common to have multiple .env files to override settings and is used in many projects. Some of the examples would be:
- project may be configured for dev (
.env.dev) and prod (.env.prod) stages and have general configuration applied to both stages (.env). - project may have standard configuration in
.envand override some settings with.env.localfor each developer.
Multiple file support is implemented for docker run and as env_file docker-compose property and it works well for environment variables in docker container. However different environment variables are very useful in docker-compose.yaml too. E.g. I have a project where url is setup via labels and I do have different urls for prod and dev stages.
Right now I think the only way to have separated dev and prod stages is having two files with all options in both them but that is not DRY and error prone when adding/changing values.
Reactions are currently unavailable