Skip to content

[would be great if] dotenv supported "source" from other envs  #422

@palladius

Description

@palladius

I have a somewhat complicated .env.{dev,staging,prod} which

source .env.common-pre

RAILS_ENV="staging"
MYSQL_ROOT_PASSWORD="blah"
MYSQL_USER="user"
MYSQL_PASS="blah"
MYSQL_HOST="1.2.3.4"
MYSQL_DBNAME="mydb"

source .env.common-post

All three environemnts source a common .env fragment at the beginning and end. In bash it works like a charm, of course.

I use dotenv for everything programmatic like passing env vars to docker, docker-compose and I LOVE it.
I would love if dotenv was able to expand on additional .env based on bash command "source".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions