diff --git a/silta-varnish/README.md b/silta-varnish/README.md index 43d20307..cc2e2e8e 100644 --- a/silta-varnish/README.md +++ b/silta-varnish/README.md @@ -2,6 +2,18 @@ Docker image based on official varnish image. +Varnish 6.x image specifics: + +- based on Debian +- runs on port 80 +- runs as root + +Varnish 7.x image specifics: + +- based on Alpine +- runs on port 8080 +- runs as varnish + ## Usage docker pull wunderio/silta-varnish. diff --git a/silta-varnish/varnish7/Dockerfile b/silta-varnish/varnish7/Dockerfile new file mode 100644 index 00000000..4d81c520 --- /dev/null +++ b/silta-varnish/varnish7/Dockerfile @@ -0,0 +1,20 @@ +FROM varnish:7.4.2-alpine + +ARG VARNISH_STORAGE_BACKEND +ARG VARNISH_EXTRA_PARAMS + +EXPOSE 8080 6082 + +COPY secret /etc/varnish/secret +COPY varnish-start.sh / + +USER root + +RUN mkdir -p -m a+w /var/lib/varnish/ \ + && chown varnish /var/lib/varnish + +COPY TAGS /TAGS + +USER varnish + +CMD ["/varnish-start.sh"] \ No newline at end of file diff --git a/silta-varnish/varnish7/TAGS b/silta-varnish/varnish7/TAGS new file mode 100644 index 00000000..9d3f8d52 --- /dev/null +++ b/silta-varnish/varnish7/TAGS @@ -0,0 +1,3 @@ +7-v1 +7-v1.0 +7-v1.0.0 diff --git a/silta-varnish/varnish7/secret b/silta-varnish/varnish7/secret new file mode 100644 index 00000000..eda95e0d --- /dev/null +++ b/silta-varnish/varnish7/secret @@ -0,0 +1 @@ +not-a-secret-123 diff --git a/silta-varnish/varnish7/varnish-start.sh b/silta-varnish/varnish7/varnish-start.sh new file mode 100755 index 00000000..2116b2e4 --- /dev/null +++ b/silta-varnish/varnish7/varnish-start.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/sbin/varnishd -F -f /etc/varnish/default.vcl -a :8080 -T :6082 -S /etc/varnish/secret -s ${VARNISH_STORAGE_BACKEND:-'file,/var/lib/varnish/varnish_storage.bin,512M'} ${VARNISH_EXTRA_PARAMS}