-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy pathDockerfile-varnish
54 lines (48 loc) · 2.06 KB
/
Dockerfile-varnish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM debian:stretch-slim
ENV VARNISH_MALLOC_SIZE="256M" \
DEBIAN_FRONTEND=noninteractive
ARG PACKAGECLOUD_URL=https://packagecloud.io/install/repositories/varnishcache/varnish60/script.deb.sh
ARG VARNISH_MODULES_VERSION=0.15.0
# Use official packages from Varnish and build with varnish-modules mainly for xkey
# see: https://github.com/varnish/varnish-modules/tree/master/docs
RUN set -xe \
&& buildDeps=" \
make \
automake \
autotools-dev \
libedit-dev \
libjemalloc-dev \
libncurses-dev \
libpcre3-dev \
libtool \
pkg-config \
python-docutils \
python-sphinx \
varnish-dev \
" \
# Update apt and get dependencies
&& apt-get update -q -y \
&& apt-get install -q -y --no-install-recommends ca-certificates curl bc net-tools \
\
# Get official Varnish package
&& curl -s ${PACKAGECLOUD_URL} | bash \
&& apt-get install -q -y --allow-unauthenticated --no-install-recommends varnish $buildDeps \
\
# Install varnish modules
&& curl -A "Docker" -o /tmp/varnish-modules.tar.gz -D - -L -s https://download.varnish-software.com/varnish-modules/varnish-modules-${VARNISH_MODULES_VERSION}.tar.gz \
&& tar zxpf /tmp/varnish-modules.tar.gz -C /tmp/ \
&& cd /tmp/varnish-modules-${VARNISH_MODULES_VERSION} \
&& ./configure \
&& make \
# && make check \
&& make install \
&& rm -f /tmp/varnish-modules.tar.gz && rm -Rf /tmp/varnish-modules \
\
# Cleanup apt cache and remove build packages
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps \
&& rm -rf /var/lib/apt/lists/*
COPY vendor/ezsystems/ezplatform-http-cache/docs/varnish/vcl/varnish5.vcl /etc/varnish/default.vcl
COPY doc/docker/entrypoint/varnish/parameters.vcl /etc/varnish/parameters.vcl
COPY doc/docker/entrypoint/varnish/entrypoint.sh /entrypoint.sh
EXPOSE 80 6082
ENTRYPOINT ["/entrypoint.sh"]