Chapter 6: harden production Docker image and dependencies
startup-product-gitea-ci/pipeline/pr-main This commit looks good

This commit is contained in:
2026-11-23 04:47:41 -05:00
parent dfbf5488d0
commit 84c88e7c0a
+3 -5
View File
@@ -1,16 +1,14 @@
FROM python:3.13-slim
FROM python:3.13-slim@sha256:e48f59cdba69a3cbd9ed2cf0f348d90d45a8d350d98134cf1070bc106ee9ed90
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
COPY requirements-production.txt .
RUN pip install --no-cache-dir -r requirements-production.txt
COPY requirements-production.lock.txt .
RUN pip install --no-cache-dir --require-hashes -r requirements-production.lock.txt
RUN useradd --create-home appuser
COPY --chown=appuser:appuser app.py .
USER appuser