From f592728c35fb97f6bc800e4dd5efda92d5d2b00f Mon Sep 17 00:00:00 2001 From: Guillaume Quintard Date: Sat, 12 Nov 2022 16:21:13 -0800 Subject: [PATCH] [varnish] add a few words about port variables --- varnish/content.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/varnish/content.md b/varnish/content.md index a16e0b383..b76c7937e 100644 --- a/varnish/content.md +++ b/varnish/content.md @@ -85,13 +85,26 @@ docker run varnish varnishreload -h ## Additional configuration +### Cache size (VARNISH_SIZE) + By default, the containers will use a cache size of 100MB, which is usually a bit too small, but you can quickly set it through the `VARNISH_SIZE` environment variable: ```console $ docker run --tmpfs /var/lib/varnish/varnishd:exec -p 8080:80 -e VARNISH_SIZE=2G %%IMAGE%% ``` -Additionally, you can add arguments to `docker run` after `%%IMAGE%%`, if the first one starts with a `-`, they will be appendend to the [default command](https://github.com/varnish/docker-varnish/blob/master/docker-varnish-entrypoint#L8): +### Listening ports (VARNISH_HTTP_PORT/VARNISH_PROXY_PORT) + +Varnish will listen to HTTP traffic on port `80`, and this can be overridden by setting the environment variable `VARNISH_HTTP_PORT`. Similarly, the variable `VARNISH_PROXY_PORT` (defaulting to `8443`) dictate the listening port for the [PROXY protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) used notably to interact with [hitch](https://hub.docker.com/_/hitch) (which, coincidentally, uses `8443` as a default too!). + +```console +# instruct varnish to listening to port 7777 instead of 80 +$ docker run --tmpfs /var/lib/varnish/varnishd:exec -p 8080:7777 -e VARNISH_HTTP_PORT=7777 %%IMAGE%% +``` + +### Extra arguments + +Additionally, you can add arguments to `docker run` after `%%IMAGE%%`, if the first argument starts with a `-`, the whole list will be appendend to the [default command](https://github.com/varnish/docker-varnish/blob/master/fresh/debian/scripts/docker-varnish-entrypoint): ```console # extend the default keep period