From 84c88e7c0aa13c0f8263b824d883ad0415f33e76 Mon Sep 17 00:00:00 2001 From: Nageshwaran Manikumar Date: Mon, 23 Nov 2026 04:47:41 -0500 Subject: [PATCH] Chapter 6: harden production Docker image and dependencies --- pricing-service/Dockerfile.production | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pricing-service/Dockerfile.production b/pricing-service/Dockerfile.production index 9a5972e..4504e21 100644 --- a/pricing-service/Dockerfile.production +++ b/pricing-service/Dockerfile.production @@ -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