Skip to content

WIP - Proposal for allowing envfile to be defined in docker-compose.yml file#8322

Closed
jonmchan wants to merge 1 commit intodocker:masterfrom
jonmchan:define-env-file-in-docker-compose
Closed

WIP - Proposal for allowing envfile to be defined in docker-compose.yml file#8322
jonmchan wants to merge 1 commit intodocker:masterfrom
jonmchan:define-env-file-in-docker-compose

Conversation

@jonmchan
Copy link
Copy Markdown

This PR does not meet coding standards. Looking for someone to take this up and add tests and documentation. I'm not familiar enough with python or this project to do this.

This is my proposal for resolving #6741. It allows the .env file to be defined from docker-compose.yml file allowing for it to be remapped to .env.docker or /dev/null to not conflict with applications that utilize the .env file.

This implementation evaluates the docker-compose.yml file an extra time, looking for x-env-file. If this is accepted as a solution, a env-file option should be added to the docker-compose schema/spec. I could not find an appropriate section to add a config option like this in the current spec.

This solution preserves the ability to utilize --env-file command line option to override the x-env-file directive in the docker-compose.yml file.

Appreciate any feedback. Thank you.

Resolves #6741

@glours
Copy link
Copy Markdown
Contributor

glours commented Jul 27, 2022

Thanks for taking the time to create this issue/pull request!

Unfortunately, Docker Compose V1 has reached end-of-life and we are not accepting any more changes (except for security issues). Please try and reproduce your issue with Compose V2 or rewrite your pull request to be based on the v2 branch and create a new issue or PR with the relevant Compose V2 information.

@glours glours closed this Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: option to disable reading from .env

3 participants