Run container as non-root via PUID/PGID with a startup entrypoint banner and logs

This commit is contained in:
Djeex
2026-08-23 14:14:54 +02:00
parent d811faef45
commit cf96acda92
5 changed files with 116 additions and 4 deletions
+4 -3
View File
@@ -2,7 +2,7 @@ FROM python:3.14.7-alpine AS base
ENV TZ=Europe/Paris
RUN apk add --no-cache tzdata curl \
RUN apk add --no-cache tzdata curl su-exec \
&& cp /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone
@@ -11,7 +11,8 @@ WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY blocklist_scheduler.py .
COPY blocklist_scheduler.py entrypoint.sh VERSION ./
RUN chmod +x entrypoint.sh
FROM base AS test
RUN pip install --no-cache-dir pytest==9.1.1
@@ -19,4 +20,4 @@ COPY tests/ tests/
COPY pytest.ini .
FROM base
ENTRYPOINT ["python3", "blocklist_scheduler.py"]
ENTRYPOINT ["./entrypoint.sh"]