You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From there, you can visit `localhost:8080` in your browser and see the example.com homepage.
54
+
31
55
Alternatively, a simple `Dockerfile` can be used to generate a new image that includes the necessary `default.vcl` (which is a much cleaner solution than the bind mount above):
32
56
33
57
```dockerfile
@@ -39,7 +63,7 @@ COPY default.vcl /etc/varnish/
39
63
Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
@@ -64,14 +88,14 @@ docker run varnish varnishreload -h
64
88
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:
65
89
66
90
```console
67
-
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G %%IMAGE%%
91
+
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -p 8080:80 -e VARNISH_SIZE=2G %%IMAGE%%
68
92
```
69
93
70
94
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):
71
95
72
96
```console
73
97
# extend the default keep period
74
-
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G %%IMAGE%% -p default_keep=300
Then you can hit `http://localhost:8080` or `http://host-ip:8080`in your browser.
116
+
As mentioned above, you can use [vmod_dynamic](https://github.com/nigoroll/libvmod-dynamic) for backend resolution. The [varnish-modules](https://github.com/varnish/varnish-modules) collection is also included in the image. All the documentation regarding usage and syntax can be found in the [src/](https://github.com/varnish/varnish-modules/tree/master/src) directory of the repository.
0 commit comments