docker-compose-development icon indicating copy to clipboard operation
docker-compose-development copied to clipboard

Update docs

Open JeroenBoersma opened this issue 6 years ago • 4 comments

What should be in the docs, rewrite the current docs, implement readthedocs.io, create sections

JeroenBoersma avatar Jun 17 '19 10:06 JeroenBoersma

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.

RenanLazarotto avatar Jun 28 '19 16:06 RenanLazarotto

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 :

  1. Install globally with :
dev composer global require mage2tv/magento-cache-clean
  1. Add this in your aliases file (e.g ~/.bash_aliases or ~/.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 "$@"
}
  1. Run cache-clean.js --watch in your Magento 2 root.
  1. Create the VCL file :
dev php bin/magento varnish:vcl:generate --backend-host=web --backend-port=80 > varnish.vcl
  1. Remove the probe with:
dev varnish-vcl-import varnish.vcl
  1. (Optional) To disable Varnish (i.e renames file from varnish.vcl to varnish.vcl.off ) run :
dev varnish-vcl-disable

For additional infos about Varnish and Magento 2 : https://github.com/JeroenBoersma/docker-compose-development/issues/113

julienloizelet avatar Sep 01 '19 16:09 julienloizelet

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"

peterjaap avatar Nov 28 '19 10:11 peterjaap

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... ;)

IJOL avatar Sep 15 '21 11:09 IJOL