mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
feat(infrastructure): rootless container
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
RUN useradd -m appuser
|
||||
USER appuser
|
||||
# Create a non-root user with a fixed numeric UID/GID so Kubernetes can verify runAsNonRoot
|
||||
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 .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
Reference in New Issue
Block a user