ddev / ddev-contrib

Contrib space for DDEV services, tools, snippets, and approaches.
Apache License 2.0
162 stars 162 forks source link

Add env_file support on env snippet. #210

Open mrhorse opened 2 years ago

mrhorse commented 2 years ago

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:

Related Issue Link(s):

rfay commented 2 years ago

Shouldn't this go into ddev's docs?

mrhorse commented 2 years ago

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 commented 2 years ago

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.