Skip to content

Support multiple .env files #7326

@aurelijusrozenas

Description

@aurelijusrozenas

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 .env and override some settings with .env.local for 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions