FROM debian:jessie

ENV DEBIAN_FRONTEND noninteractive

# Use packages from Varnish to get Varnsih 5.1, currently does not work on debian:stretch
RUN apt-get update -q -y && \
    apt-get install -q -y --force-yes --no-install-recommends ca-certificates curl && \
    curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh | bash && \
    apt-get install -q -y --force-yes --no-install-recommends varnish

# This will need debian:stretch, just here for referance, had segmentation faults so rather using varnsih 5.1 above
#RUN \
#    apt-get update -q -y && \
#    apt-get install -q -y --force-yes --no-install-recommends ca-certificates varnish-modules varnish


EXPOSE 80 6082

CMD ["varnishd", "-F", "-a", ":80", "-T", ":6082", "-f", "/etc/varnish/default.vcl", "-s", "malloc,256M"]
