webkul/varnish_for_magento2

By webkul

Updated about 7 years ago

Docker Image for Varnish 4.1.1 with configuration file compatible with latest Magento 2

Image

578

This Docker Image can be used to run a Docker container with Varnish Cache as one of its service. Varnish Configuration File present at location /etc/varnish/default.vcl is compatible with Magento 2 latest version (2.2.2) with OS ubuntu 16.04.

To begin with this image, docker must be installed and running on your server. To pull this Image, run the following command on your docker installed server:

docker pull webkul/varnish_for_magento2

Now when Image has been pulled, you can check its presence by running command:

docker images

Now, you can run docker container from this Image to start a Varnish Cache server. There must be a Magento 2 running on the server for whom varnish will act as a HTTP accelerator.

Inside the docker container, Varnish cache will run on port 6081. You can map it whichever port on the host. So let's launch the container from the image as:

docker run -tidp host_port:container_port -e BACKEND_PORT=magento2_server_port -e BACKEND_HOST=magento2_server_IP webkul/varnish_for_magento2

Example: docker run -tidp 80:6081 -e BACKEND_PORT=8080 -e BACKEND_HOST=192.168.X.X webkul/varnish_for_magento2

Where 192.168.X.X is Magento 2 Store IP and webserver is running on port 8080.

Please visit https://cloudkul.com/blog/varnish-docker-image-magento-2/ for detailed information.

Docker Pull Command

docker pull webkul/varnish_for_magento2