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.
105
+
82
106
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):
83
107
84
108
```dockerfile
@@ -90,7 +114,7 @@ COPY default.vcl /etc/varnish/
90
114
Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
@@ -115,14 +139,14 @@ docker run varnish varnishreload -h
115
139
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:
116
140
117
141
```console
118
-
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G varnish
142
+
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -p 8080:80 -e VARNISH_SIZE=2G varnish
119
143
```
120
144
121
145
Additionally, you can add arguments to `docker run` after `varnish`, 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):
122
146
123
147
```console
124
148
# extend the default keep period
125
-
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G varnish -p default_keep=300
Then you can hit `http://localhost:8080` or `http://host-ip:8080`in your browser.
167
+
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