varnish add
This commit is contained in:
@@ -1,31 +1,43 @@
|
|||||||
FROM debian:trixie-slim
|
# --- Stage 1: build varnish + modules ---
|
||||||
|
FROM debian:trixie-slim AS builder
|
||||||
|
|
||||||
ARG VARNISH_VERSION=8.0.0
|
ARG VARNISH_VERSION=8.0.0
|
||||||
ARG VARNISH_MODULES_VERSION=0.27.0
|
ARG VARNISH_MODULES_VERSION=0.27.0
|
||||||
|
|
||||||
# potrzebne narzędzia do kompilacji
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
curl build-essential automake autoconf libtool pkg-config python3-sphinx \
|
curl build-essential automake autoconf libtool pkg-config python3-sphinx \
|
||||||
git ca-certificates \
|
git ca-certificates \
|
||||||
libpcre2-dev \
|
libpcre2-dev libedit-dev \
|
||||||
libedit-dev \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# instalacja varnish
|
# build varnish
|
||||||
RUN curl -fsSL https://varnish-cache.org/_downloads/varnish-${VARNISH_VERSION}.tgz -o varnish.tar.gz \
|
RUN curl -fsSL https://varnish-cache.org/_downloads/varnish-${VARNISH_VERSION}.tgz -o varnish.tar.gz \
|
||||||
&& tar xzf varnish.tar.gz \
|
&& tar xzf varnish.tar.gz \
|
||||||
&& cd varnish-${VARNISH_VERSION} \
|
&& cd varnish-${VARNISH_VERSION} \
|
||||||
&& ./configure && make -j$(nproc) && make install \
|
&& ./configure && make -j$(nproc) && make install \
|
||||||
&& cd .. && rm -rf varnish-${VARNISH_VERSION} varnish.tar.gz
|
&& cd .. && rm -rf varnish-${VARNISH_VERSION} varnish.tar.gz
|
||||||
|
|
||||||
# instalacja varnish-modules (w tym vsthrottle)
|
# build varnish-modules
|
||||||
RUN curl -fsSL https://github.com/varnish/varnish-modules/releases/download/${VARNISH_MODULES_VERSION}/varnish-modules-${VARNISH_MODULES_VERSION}.tar.gz -o modules.tar.gz \
|
RUN curl -fsSL https://github.com/varnish/varnish-modules/releases/download/${VARNISH_MODULES_VERSION}/varnish-modules-${VARNISH_MODULES_VERSION}.tar.gz -o modules.tar.gz \
|
||||||
&& tar xzf modules.tar.gz \
|
&& tar xzf modules.tar.gz \
|
||||||
&& cd varnish-modules-${VARNISH_MODULES_VERSION} \
|
&& cd varnish-modules-${VARNISH_MODULES_VERSION} \
|
||||||
&& ./configure && make -j$(nproc) && make install \
|
&& ./configure && make -j$(nproc) && make install \
|
||||||
&& cd .. && rm -rf varnish-modules-${VARNISH_MODULES_VERSION} modules.tar.gz
|
&& cd .. && rm -rf varnish-modules-${VARNISH_MODULES_VERSION} modules.tar.gz
|
||||||
|
|
||||||
# katalog na konfigurację
|
# --- Stage 2: runtime ---
|
||||||
|
FROM debian:trixie-slim AS runtime
|
||||||
|
|
||||||
|
# tylko to co potrzebne do uruchomienia varnish
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libpcre2-8-0 \
|
||||||
|
libedit2 \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# kopiujemy binaria i moduły z buildera
|
||||||
|
COPY --from=builder /usr/local /usr/local
|
||||||
|
|
||||||
WORKDIR /etc/varnish
|
WORKDIR /etc/varnish
|
||||||
COPY default.vcl /etc/varnish/
|
COPY default.vcl /etc/varnish/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user