Browse Source

[varnish] streamline a bit

Guillaume Quintard 6 years ago
parent
commit
146df4cab5
2 changed files with 4 additions and 49 deletions
  1. 3 48
      varnish/content.md
  2. 1 1
      varnish/github-repo

+ 3 - 48
varnish/content.md

@@ -16,8 +16,7 @@ Create a `default.vcl` file:
 vcl 4.0;
 
 backend default {
-  .host = "www.nytimes.com";
-  .port = "80";
+  .host = "www.nytimes.com:80";
 }
 ```
 
@@ -32,13 +31,13 @@ Alternatively, a simple `Dockerfile` can be used to generate a new image that in
 ```dockerfile
 FROM %%IMAGE%%:6.2
 
-COPY default.vcl /usr/local/etc/varnish/
+COPY default.vcl /etc/varnish/
 ```
 
 Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
 
 ```console
-$ docker run --name my-running-varnish --tmpfs /usr/local/var/varnish:exec -d my-varnish
+$ docker run --name my-running-varnish --tmpfs /var/lib/varnish:exec -d my-varnish
 ```
 
 ### Exposing the port
@@ -48,47 +47,3 @@ $ docker run --name my-running-varnish --tmpfs /usr/local/var/varnish:exec -d -p
 ```
 
 Then you can hit `http://localhost:8080` or `http://host-ip:8080` in your browser.
-
-# How to install VMODs (Varnish Modules)
-
-[VMODs](https://varnish-cache.org/vmods/) are extensions written for Varnish Cache.
-
-Install VMODs in your Varnish project's `Dockerfile`. For example, to install the [vmod-querystring](https://github.com/Dridi/libvmod-querystring) module:
-
-```dockerfile
-FROM %%IMAGE%%:6.2
-
-# install vmod-querystring
-ENV VMOD_QUERYSTRING_VERSION 1.0.5
-RUN set -eux; \
-	\
-	fetchDeps=' \
-		ca-certificates \
-		wget \
-	'; \
-	buildDeps=" \
-		$VMOD_BUILD_DEPS \
-		dpkg-dev \
-	"; \
-	apt-get update; \
-	apt-get install -y --no-install-recommends $fetchDeps $buildDeps; \
-	rm -rf /var/lib/apt/lists/*; \
-	\
-	wget -O vmod-querystring.tar.gz "https://github.com/Dridi/libvmod-querystring/releases/download/v$VMOD_QUERYSTRING_VERSION/vmod-querystring-$VMOD_QUERYSTRING_VERSION.tar.gz"; \
-	mkdir -p /usr/local/src/vmod-querystring; \
-	tar -zxf vmod-querystring.tar.gz -C /usr/local/src/vmod-querystring --strip-components=1; \
-	rm vmod-querystring.tar.gz; \
-	\
-	cd /usr/local/src/vmod-querystring; \
-	gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
-	./configure \
-		--build="$gnuArch" \
-	; \
-	make -j "$(nproc)"; \
-	make install; \
-	\
-	cd /; \
-	rm -rf /usr/local/src/vmod-querystring; \
-	\
-	apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps $buildDeps
-```

+ 1 - 1
varnish/github-repo

@@ -1 +1 @@
-https://github.com/coopTilleuls/docker-varnish
+https://github.com/varnish/docker-varnish