Skip to content

Commit

Permalink
Upgrading to Caddy 2.8.4 (and python 3.12)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Jun 3, 2024
1 parent eb80c57 commit 74cc28a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions reverse-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM caddy:2.7.6-alpine
FROM caddy:2.8.4-alpine
LABEL org.opencontainers.image.source https://github.com/offspot/container-images

RUN \
# openssl required to generate cert when CAPTIVE_PORTAL is on
apk add --no-cache dumb-init python3 py3-pip && \
pip3 install --no-cache-dir -U pip && \
pip3 install --no-cache-dir Jinja2==3.1.2
apk add --no-cache dumb-init python3 \
&& python3 -m venv /usr/local/proxy-env \
&& /usr/local/proxy-env/bin/pip3 install --no-cache-dir -U pip \
&& /usr/local/proxy-env/bin/pip3 install --no-cache-dir Jinja2==3.1.2

COPY Caddyfile /etc/caddy/
COPY gen-caddyfile.py /src/
Expand All @@ -19,8 +20,8 @@ ENV IS_ONLINE_DEMO ""
ENV DEMO_TLS_EMAIL "[email protected]"

# store python bytecode in image
RUN python3 -m compileall /src/gen-caddyfile.py && mv /src/__pycache__/*.pyc /usr/local/lib/
RUN /usr/local/proxy-env/bin/python3 -m compileall /src/gen-caddyfile.py && mv /src/__pycache__/*.pyc /usr/local/lib/

ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/bin/python3", "/usr/local/lib/gen-caddyfile.cpython-311.pyc"]
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/proxy-env/bin/python3", "/usr/local/lib/gen-caddyfile.cpython-312.pyc"]
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]

0 comments on commit 74cc28a

Please sign in to comment.