Magento2 icon indicating copy to clipboard operation
Magento2 copied to clipboard

docker-compose-dev.yml is not used

Open vrgfa opened this issue 7 years ago • 3 comments

In the mac/windows version of the start script the following changes seem to be needed to use the docker-sync volume properly: .... docker-sync start &&
docker-compose up -d &&
.... docker-sync start &&
docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d &&
.... If "docker-sync-stack start" is used as described in https://github.com/EugenMayer/docker-sync/wiki/Keep-your-docker-compose.yml-portable, it picks up docker-compose-dev.yml, otherwise the setup seems to lack docker-compose-dev.yml and it all ends up with a native - and quite slow - volume mount.

vrgfa avatar Jan 15 '18 18:01 vrgfa

Hi Ferenc, Thanks for this report, I didn't implement it because I'm trying to understand why to use the docker-compose-dev.yml. On Mac, I don't see a performance issue because I use docker-sync.yml. Seems like the docker-compose-dev.yml is used just to override the docker-compose.yml when necessary, am I wrong?

rafaelstz avatar Jan 15 '18 20:01 rafaelstz

Hi Rafael, Oh, I see where the confusion lies now - the docker-compose.yml in your mac branch has the content of the docker-compose-dev.yml already merged with it: volumes: <project_name>-sync: external: true so it uses the volume provided by the docker-sync defined in docker-sync.yml.

docker-compose-dev.yml as suggested in the documentation of docker-sync, too, is supposed to override a common docker-compose.yml, which in this way should be the same both for production and dev -- in this case in your mac and master branch What we did was to to copy a slightly modified prod version of your docker-compose.yml (the one in your master branch) to all our environments, assuming it is overridden on our Macs by the docker-compose-dev.yml so the web server uses the volume provided by the the docker-sync container. At the moment, though, this only happens with the changes above when the containers are started with docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -- docker-sync-stack start automagically starts the containers with -f docker-compose.yml -f docker-compose-dev.yml in the background, with docker-sync, starting the container in the background, you have to do it explicitly. So yes, if a docker-compose-dev.yml is included, I suggest containers should be started in a way that it overrides the original docker-compose.yml in all cases and it is the best to use a common cocker-compose.yml across all environments.

vrgfa avatar Jan 15 '18 21:01 vrgfa

Thanks for your thoughts, I'll test it to implement in production or in a future beta branch.

rafaelstz avatar Jan 16 '18 13:01 rafaelstz