feat(infrastructure): rootless container

This commit is contained in:
2025-10-05 21:05:42 +02:00
parent 48d56681fb
commit 7b9d72791f

View File

@@ -1,8 +1,12 @@
FROM python:3.11-slim FROM python:3.11-slim
WORKDIR /app WORKDIR /app
RUN useradd -m appuser # Create a non-root user with a fixed numeric UID/GID so Kubernetes can verify runAsNonRoot
USER appuser RUN groupadd -g 1000 appgroup \
&& useradd -u 1000 -g 1000 -m appuser \
&& chown -R 1000:1000 /app
# Use numeric UID to avoid "non-numeric user" errors in Kubernetes
USER 1000
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt