Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Add env_file support on env snippet. #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrhorse
Copy link

@mrhorse mrhorse commented Mar 17, 2022

The New Solution/Problem/Issue/Bug:

No env file support provided on the env snippet.

How this PR Solves The Problem:

Provides example snippet with comment. Allows docker-compose to load env files. This is a widely known issue with ddev, i.e. the lack of env file support.

Taken from the offical docs:
https://docs.docker.com/compose/environment-variables/#the-env_file-configuration-option

Manual Testing Instructions:

  • Add snippet to .ddev folder
  • Add .env file to project root, declaring at least one environment variable.
  • Boot the ddev project. In the project code do print_r($_ENV);
  • Refresh front-end - given environment variable(s) in the env file should be present in the array.

Related Issue Link(s):

@rfay
Copy link
Member

rfay commented Mar 17, 2022

Shouldn't this go into ddev's docs?

@mrhorse
Copy link
Author

mrhorse commented Mar 18, 2022

As well as here? Probably. Found a solution and wanted to contribute back is all :) . The docs have pointed to this repo for anything on the level of adding custom docker-compose partials.

@rfay
Copy link
Member

rfay commented Mar 18, 2022

Yeah, just improve https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-environment-variables-to-a-container - I've been meaning to explore this feature of docker-compose and didn't get it done yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants