aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2016-11-18 17:05:48 +0100
committerKristian Lyngstol <kly@kly.no>2016-11-18 17:05:48 +0100
commit06591202ce5549a949343f0f5f8959771a1b5657 (patch)
tree2d8b8ca28bf7715886a56fd477a62e4ca6812f2f
parent6af39a472dc36b1b6c85e5bb24147ee16c0536c2 (diff)
Make the varnish include a persistent config
E.g.: For authorization. We bootstrap the file as empty by default, which means 0 authentication.
-rw-r--r--build/test/gondul-varnish-test.Dockerfile4
-rwxr-xr-xbuild/test/varnish-init.sh4
-rw-r--r--extras/misc/varnish.vcl2
3 files changed, 7 insertions, 3 deletions
diff --git a/build/test/gondul-varnish-test.Dockerfile b/build/test/gondul-varnish-test.Dockerfile
index 7e75b86..90bd369 100644
--- a/build/test/gondul-varnish-test.Dockerfile
+++ b/build/test/gondul-varnish-test.Dockerfile
@@ -2,7 +2,5 @@ FROM debian:jessie
RUN apt-get update
RUN apt-get -y install varnish
-RUN rm /etc/varnish/default.vcl
-ADD extras/misc/varnish.vcl /etc/varnish/default.vcl
-CMD varnishd -a :80 -f /etc/varnish/default.vcl -F
+CMD /opt/gondul/build/test/varnish-init.sh
EXPOSE 80
diff --git a/build/test/varnish-init.sh b/build/test/varnish-init.sh
new file mode 100755
index 0000000..9b16722
--- /dev/null
+++ b/build/test/varnish-init.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+touch /opt/gondul/data/varnish-auth.vcl
+exec varnishd -a :80 -f /opt/gondul/extras/misc/varnish.vcl -F
diff --git a/extras/misc/varnish.vcl b/extras/misc/varnish.vcl
index 4920963..8f67a4d 100644
--- a/extras/misc/varnish.vcl
+++ b/extras/misc/varnish.vcl
@@ -2,6 +2,8 @@
vcl 4.0;
+include "/opt/gondul/data/varnish-auth.vcl";
+
backend default {
.host = "gondul-front";
.port = "80";