This image is intended to provide a caching and load balancing layer in front of web containers.
$ docker run -d -P \
--link container \
--link another_container \
creativearea/varnishTo run the container you need to link the containers you want to run behind the load balancer that Varnish will create. Varnish will detect all the backend containers you pass and will add them to the load balancer. The only requirement is that your linked backends expose the port 80.
Varnish will use the following environment variables. You can override them if you want
VARNISH_VCL_CONF/etc/varnish/default.vclVARNISH_LISTEN_ADDRESS0.0.0.0VARNISH_LISTEN_PORT80VARNISH_ADMIN_LISTEN_ADDRESS0.0.0.0VARNISH_ADMIN_LISTEN_PORT6082VARNISH_MIN_THREADS1VARNISH_MAX_THREADS1000VARNISH_THREAD_TIMEOUT120VARNISH_SECRET_FILE/etc/varnish/secretVARNISH_STORAGEmalloc,100MVARNISH_TTL120VARNISH_NCSA_LOGFORMAT"%h %l %u %t %D "%r" %s %b %{Varnish:hitmiss}x "%{User-agent}i""
- The VCL config is based on Mattias Geniar Varnish 4 configuration templates