|
@@ -42,7 +42,24 @@ Place this file in the same directory as your `default.vcl`, run `docker build -
|
|
|
$ docker --tmpfs /var/lib/varnish:exec my-varnish
|
|
$ docker --tmpfs /var/lib/varnish:exec my-varnish
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-### Additional configuration
|
|
|
|
|
|
|
+## Reloading the configuration
|
|
|
|
|
+
|
|
|
|
|
+The images all ship with [varnishreload](https://github.com/varnishcache/pkg-varnish-cache/blob/master/systemd/varnishreload#L42) which allows you to easily update the running configuration without restarting the container (and therefore losing your cache). At its most basic, you just need this:
|
|
|
|
|
+
|
|
|
|
|
+```console
|
|
|
|
|
+# update the default.vcl in your container
|
|
|
|
|
+docker cp new_default.vcl running_container:/etc/varnish/default.vcl
|
|
|
|
|
+# run varnishreload
|
|
|
|
|
+docker exec running_container varnishreload
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+Note that `varnishreload` also supports reloading other files (it doesn't have to be `default.vcl`), labels (`l`), and garbage collection of old labeles (`-m`) among others. To know more, run
|
|
|
|
|
+
|
|
|
|
|
+```console
|
|
|
|
|
+docker run varnish varnishreload -h
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+## Additional configuration
|
|
|
|
|
|
|
|
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:
|
|
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:
|
|
|
|
|
|
|
@@ -70,7 +87,7 @@ $ docker run %%IMAGE%% varnishd -x parameter
|
|
|
$ docker run %%IMAGE%% varnishd -a :8080 -b 127.0.0.1:8181 -t 600 -p feature=+http2
|
|
$ docker run %%IMAGE%% varnishd -a :8080 -b 127.0.0.1:8181 -t 600 -p feature=+http2
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-### Exposing the port
|
|
|
|
|
|
|
+## Exposing the port
|
|
|
|
|
|
|
|
```console
|
|
```console
|
|
|
+$ docker run --name my-running-varnish --tmpfs /var/lib/varnish:exec -d -p 8080:80 my-varnish
|
|
+$ docker run --name my-running-varnish --tmpfs /var/lib/varnish:exec -d -p 8080:80 my-varnish
|