docker-compose-development
docker-compose-development copied to clipboard
Update docs
What should be in the docs, rewrite the current docs, implement readthedocs.io, create sections
Hey Jeroen! Please allow me to ask for one thing: don't forget to put in the documentation a reminder that you have to add your user to the docker group. I consider this important because I always forget about it and I keep asking myself why the dev commands asks for my password =)
I was just about to open an issue about this when I remembered that you should manually do that after installing your docker stack. Or you could consider adding this to the bin/dev setup command, so it does it automatically.
Hi @JeroenBoersma , I am currently using this docker-compose-development repo to work with Magento 2 (thanks for sharing with us!). Maybe it is not a good idea to have a specific Magento 2 section but, if it has a sense for you, here is what I found while digging in the Magento 2 related closed issues :
- How to work with Mage2Tv clean-cache.js tool ? To summarize (I tested and it worked) :
- Install globally with :
dev composer global require mage2tv/magento-cache-clean
- Add this in your aliases file (e.g
~/.bash_aliasesor~/.zshrc) :
cache-clean.js () {
dev php /data/.composer/vendor/mage2tv/magento-cache-clean/bin/generate-cache-clean-config.php
dev node /data/.composer/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js "$@"
}
- Run
cache-clean.js --watchin your Magento 2 root.
- Working with Varnish and Magento 2 To summarize (Did not test it yet) :
- Create the VCL file :
dev php bin/magento varnish:vcl:generate --backend-host=web --backend-port=80 > varnish.vcl
- Remove the probe with:
dev varnish-vcl-import varnish.vcl
- (Optional) To disable Varnish (i.e renames file from
varnish.vcltovarnish.vcl.off) run :
dev varnish-vcl-disable
For additional infos about Varnish and Magento 2 : https://github.com/JeroenBoersma/docker-compose-development/issues/113
Don't forget to set the correct http cache host;
VARNISH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps | grep varnish | cut -d ' ' -f1))
bin/magento setup:config:set --http-cache-hosts="$VARNISH_IP:80"
Don't forget to set the correct http cache host;
VARNISH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps | grep varnish | cut -d ' ' -f1)) bin/magento setup:config:set --http-cache-hosts="$VARNISH_IP:80"
I think this advice maybe ill, i've followed julien's advice in https://github.com/JeroenBoersma/docker-compose-development/issues/113#issuecomment-535545061 and AFAIK its the correct one, the ip need is that from the ssl container not the varnish one so grep for ssl instead:
VARNISH_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps | grep ssl | cut -d ' ' -f1)) bin/magento setup:config:set --http-cache-hosts="$VARNISH_IP:80"
for those like me stumbled lately with this issue and have managed to follow all the recipes... ;)