Chapter 6: harden production Docker image and dependencies
startup-product-gitea-ci/pipeline/pr-main This commit looks good
startup-product-gitea-ci/pipeline/pr-main This commit looks good
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user