docker4drupal icon indicating copy to clipboard operation
docker4drupal copied to clipboard

What about .env.local?

Open ABGEO opened this issue 5 years ago • 2 comments

I often use the .env.local file (ignored from git) to override environment variables. Every time I do it manually (I include the .local file after the main .env). I think that not only I do it :). I would be glad if we added this feature to the stack.

If you agree with me, I can implement this feature.

ABGEO avatar Dec 17 '19 17:12 ABGEO

Not sure I understand what env vars do you need to override, do you want to have a custom set of image tags or do you want extra env vars in your php containers? If latter you could have just added .env.local as env_file of the php service?

I know a lot of people fork this repository (and as I understand this is your case as well) and then add drupal to it but I don't think this is the best way, I think people should fork http://github.com/drupal-composer/drupal-project and add docker4drupal files manually (from the release archive as we describe it in docs) because normally you wouldn't need all services from the default docker-compose.yml and it is safer to apply upgrades selectively instead of merging with upstream

csandanov avatar Dec 18 '19 03:12 csandanov

At this point, to handle all of my environments and such, I scaffold my env with a script. This way I can parse out docker4drupal env from staging/production. It's really the best solution I've found.

Think of a config/env directory with a local, staging, production file, and then a simple script you call when updating or deploying that copies it into the root.

@csandanov rather than a straight fork, I match up project history and use docker4drupal as an remote. There is another script that rolls updates in, and then I apply a set of commits that match things up. We could do alot to parse out what is D4D and what is Drupal. I'm about to submit a feature request that cleans up some linux/mac extra config, more will come as I start ramping up efforts :)

devkinetic avatar Apr 29 '20 17:04 devkinetic