From dd034b11d94b6eee9c1a30e80768c6c24429382e Mon Sep 17 00:00:00 2001 From: sinnottj-rse Date: Fri, 9 Jan 2026 16:45:44 +0000 Subject: [PATCH] Don't store python build artefacts/pip cache in the image. Combine commands into a single RUN step where possible to avoid creating unnecessary image layers. --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff38baf..36401dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ FROM python:3.14-slim +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + COPY requirements.txt requirements.txt -RUN pip install -U pip -RUN pip install -r requirements.txt +RUN pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt COPY . /app WORKDIR /app