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

Substitute variables from env_file in configuration file #2352

Closed
djmaze opened this issue Nov 9, 2015 · 2 comments
Closed

Substitute variables from env_file in configuration file #2352

djmaze opened this issue Nov 9, 2015 · 2 comments

Comments

@djmaze
Copy link

djmaze commented Nov 9, 2015

The new environment variable substitution is really handy. But as using a .env file is a common pattern for many projects, it should be possible to use env_file in combination with $VARIABLE substitution in the docker-compose.yml.

Often this is much more useful then just using variables from the current shell environment. This way, local configuration and credentials can stay out of version control (e.g. container hostnames, ports or database passwords).

@glenngillen
Copy link

I've been taking this approach with either a bash alias, forego, foreman, or shoreman as a process wrapper for docker-compose.

I'm aware all of these are addressing the symptoms though. Would be great if docker-compose could itself read in and export the values for the current command.

FWIW my shell alias is just:

alias hkenv='export $(cat .env)'

@dnephin
Copy link

dnephin commented Jan 12, 2016

I don't think we want to re-use env_file, that would be overloading the concept. However there is a related proposal in #2636 to use a different file. I'm going to close this issue for that one, I believe they are requesting the same feature.

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

3 participants