bolt / project

🚀 Repo to `composer create project` a Bolt 5 project.
MIT License
39 stars 38 forks source link

Use of .env file by docker-compose has side-effect of copying it to the container #36

Closed simongroenewolt closed 3 years ago

simongroenewolt commented 3 years ago

In docker-compose.yml the .env file is used (specified with env_file) to configure a number of settings.

Using .env this way has the 'side effect' of copying .env into the container. (Or at least, that is what I saw in a comment on https://github.com/docker/compose/issues/4140 - and it's the observed behavior by a bolt user on slack)

The effect is that you can edit almost all files when using docker, and the changes will be picked up, but if you edit .env the changes will not be picked up by the container. That is quite confusing.

I don't know if there is a real fix possible for this. A separate env file for docker with a comment explaining it won't be reloaded would be clear, but might mean duplication of config.

toofff commented 3 years ago

@simongroenewolt

The problem with using of the .env file like this is that it serves both for the docker and for the Symfony application as well.

In my pull request #31, I don't do that.

I invite you to test my PR to see if it solves your problems.

bobdenotter commented 3 years ago

Is this also resolved now that #31 has landed?

simongroenewolt commented 3 years ago

@bobdenotter yes this one is resolved. The .env file is no longer used as env_file in docker-compose.yml, so it should not be handled as a special case anymore.

bobdenotter commented 3 years ago

Okido, closing this one, then! :-)