Slim down container images and move them to Python 3.14 and Debian Trixie

This commit is contained in:
Eduardo Silva
2026-11-17 09:49:59 -03:00
parent 61c0d59dd2
commit 894993226f
8 changed files with 12 additions and 22 deletions
@@ -1,4 +1,4 @@
FROM python:3.12-alpine
FROM python:3.14-alpine
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
-5
View File
@@ -2,14 +2,9 @@ FROM caddy:2
RUN apk add --no-cache \
python3 \
py3-pip \
py3-yaml \
inotify-tools \
bash
RUN python3 -m venv /usr/local/bin/.venv && \
/usr/local/bin/.venv/bin/pip install --no-cache-dir pyyaml
COPY export_wireguard_webadmin_config.py /usr/local/bin/export_wireguard_webadmin_config.py
COPY process_config.py /usr/local/bin/process_config.py
COPY entrypoint.sh /usr/local/bin/caddy-entrypoint.sh
+1 -1
View File
@@ -3,7 +3,7 @@
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PYTHON="${SCRIPT_DIR}/.venv/bin/python3"
PYTHON="python3"
JSON_DIR="${JSON_DIR:-/caddy_json_export}"
CADDYFILE_PATH="${CADDYFILE_PATH:-/etc/caddy/Caddyfile}"
@@ -1,10 +1,10 @@
# Single stage build for Cluster Node
FROM python:3.12-slim
FROM python:3.14-slim
WORKDIR /app
# Install necessary runtime packages
RUN apt-get update && apt-get install -y --no-install-recommends \
wireguard \
wireguard-tools \
iptables \
iproute2 \
net-tools \
@@ -21,13 +21,11 @@ COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . /app/
COPY cluster_worker.py entrypoint.sh /app/
# Set execution permissions on scripts
RUN chmod +x /app/entrypoint.sh
ARG SERVER_ADDRESS
ARG DEBUG_MODE
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python", "-u", "/app/cluster_worker.py"]
+2 -2
View File
@@ -1,6 +1,6 @@
FROM ubuntu:latest
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y cron curl && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends cron curl ca-certificates procps && rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /entrypoint.sh
COPY cron_runner.sh /cron_runner.sh
+2 -2
View File
@@ -1,9 +1,9 @@
FROM ubuntu:latest
FROM debian:trixie-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y dnsmasq nano inotify-tools psmisc && \
apt-get install -y --no-install-recommends dnsmasq nano inotify-tools procps && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
+2 -5
View File
@@ -1,14 +1,11 @@
FROM python:3.12-slim
FROM python:3.14-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends \
net-tools \
inetutils-ping \
inetutils-traceroute \
nano \
vim-nox \
rrdtool \
librrd-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .