diff --git a/Dockerfile b/Dockerfile index 2a730cc..bdfc73e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,34 @@ -FROM debian:stretch - -LABEL maintainer "mikoj@mynwt.eu" - -ENV DEBIAN_FRONTEND noninteractive - -RUN \ - apt-get update && \ - apt-get -y install apt-transport-https curl gnupg psmisc && \ - curl -L https://packagecloud.io/varnishcache/varnish60/gpgkey | apt-key add - && \ - touch /etc/apt/sources.list.d/varnishcache_varnish60.list && \ - echo 'deb https://packagecloud.io/varnishcache/varnish60/debian/ stretch main' > /etc/apt/sources.list.d/varnishcache_varnish60.list && \ - echo 'deb-src https://packagecloud.io/varnishcache/varnish60/debian/ stretch main' >> /etc/apt/sources.list.d/varnishcache_varnish60.list && \ - apt-get update && \ - apt-get -y install varnish=6.0.0-1~stretch && \ - rm -rf /var/lib/apt/lists/* - -WORKDIR / - -ADD start_varnishd.sh /start.sh - -ENV VARNISH_MALLOC '256m' -ENV VARNISH_LOG 1 -ENV VARNISH_LOG_FORMAT '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" %{Varnish:hitmiss}x' - -RUN ln -sf /dev/stdout /var/log/varnish/access.log - -EXPOSE 80 6082 - -RUN chmod +x /start.sh -# Start the varnishd -ENTRYPOINT ["./start.sh"] +FROM debian:stretch + +LABEL maintainer "mikoj@mynwt.eu" + +ENV DEBIAN_FRONTEND noninteractive + +RUN \ + apt-get update && \ + apt-get -y install apt-transport-https curl gnupg psmisc && \ + curl -L https://packagecloud.io/varnishcache/varnish60/gpgkey | apt-key add - && \ + touch /etc/apt/sources.list.d/varnishcache_varnish60.list && \ + echo 'deb https://packagecloud.io/varnishcache/varnish60/debian/ stretch main' > /etc/apt/sources.list.d/varnishcache_varnish60.list && \ + echo 'deb-src https://packagecloud.io/varnishcache/varnish60/debian/ stretch main' >> /etc/apt/sources.list.d/varnishcache_varnish60.list && \ + apt-get update + +RUN \ + apt-get -y install varnish=6.0.0-1~stretch && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR / + +ADD start_varnishd.sh /start.sh + +ENV VARNISH_MALLOC '256m' +ENV VARNISH_LOG 1 +ENV VARNISH_LOG_FORMAT '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" %{Varnish:hitmiss}x' + +RUN ln -sf /dev/stdout /var/log/varnish/access.log + +EXPOSE 80 6082 + +RUN chmod +x /start.sh +# Start the varnishd +ENTRYPOINT ["./start.sh"] diff --git a/LICENSE b/LICENSE index 6a81a17..28833a8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Grzegorz Synowiec +Copyright (c) 2018 Grzegorz Mikoj Synowiec Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/start_varnishd.sh b/start_varnishd.sh index f47e592..abce7f9 100644 --- a/start_varnishd.sh +++ b/start_varnishd.sh @@ -24,6 +24,7 @@ if [ $VARNISH_LOG -eq 1 ]; then /usr/bin/varnishncsa -D -a -F "$VARNISH_LOG_FORMAT" -w /var/log/varnish/access.log 2>&1 & fi +echo "Starting varnishd" /usr/sbin/varnishd -F -a :80 -T :6082 -f /etc/varnish/default.vcl -s malloc,${VARNISH_MALLOC} 2>&1 & VARNISHD_PID=$!