clean-docker / Magento2

Docker Image to Magento 2 local development in Mac, Linux and Windows
https://hub.docker.com/r/rafaelcgstz/magento2/
MIT License
444 stars 251 forks source link

docker-compose-dev.yml is not used #33

Open vrgfa opened 6 years ago

vrgfa commented 6 years ago

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.

rafaelstz commented 6 years ago

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?

vrgfa commented 6 years ago

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:

-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.
rafaelstz commented 6 years ago

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