Closed simongroenewolt closed 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.
.env
file is dedicated to the Symfony application, the variables for the docker are directly in the docker-compose.yml
file.env
file is imported into the Dockerfile
file, then we extract variables of the .env
file and delete it. Very good for a production image.docker-compose.yml
file (for the local environment) adds a volume to the root of the project, so that the .env
file can be hot modified.I invite you to test my PR to see if it solves your problems.
Is this also resolved now that #31 has landed?
@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.
Okido, closing this one, then! :-)
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.