From 9e19b0b6be21d0d9f097f36e15daa9c1847cdc2a Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 12:41:06 +0000 Subject: [PATCH 1/2] Use Debian base image with uv installed from official Docker image Replaces python:3.13-slim with debian:bookworm-slim and installs uv directly from ghcr.io/astral-sh/uv:0.10.4, eliminating the need to create a Python venv first and install uv via pip. uv now manages Python installation automatically. This follows the uv Docker integration guide more closely. Co-Authored-By: Claude Haiku 4.5 --- src/mock_vws/_flask_server/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mock_vws/_flask_server/Dockerfile b/src/mock_vws/_flask_server/Dockerfile index 4981a38f4..0d23b65d4 100644 --- a/src/mock_vws/_flask_server/Dockerfile +++ b/src/mock_vws/_flask_server/Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.13-slim AS base +FROM debian:bookworm-slim AS base +COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /uvx /bin/ # We set this pretend version as we do not have Git in our path, and we do # not care enough about having the version correct inside the Docker container # to install it. ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 # Avoid using root user. -# This avoids having to use ``--root-user-action=ignore`` with pip. RUN useradd -ms /bin/bash myuser USER myuser COPY --chown=myuser:myuser . /app @@ -15,9 +15,7 @@ ENV UV_PROJECT_ENVIRONMENT=/app/docker_venvs/.venv ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH" WORKDIR /app -RUN python3 -m venv $UV_PROJECT_ENVIRONMENT && \ - pip install --no-cache-dir uv==0.10.4 && \ - uv sync --no-cache +RUN uv sync --no-cache EXPOSE 5000 ENTRYPOINT ["python"] HEALTHCHECK --interval=1s --timeout=10s --start-period=5s --retries=3 CMD ["python", "/app/src/mock_vws/_flask_server/healthcheck.py"] From 1c73ee790f70929cfb5342adb9d3fd36e2ffca9a Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 13:18:42 +0000 Subject: [PATCH 2/2] Use uv image with Python 3.13 as base ghcr.io/astral-sh/uv:0.10.4-python3.13-trixie-slim includes both uv and Python 3.13, avoiding the need to download a managed Python at build time which caused Docker builds in tests to be 3-4x slower. Co-Authored-By: Claude Haiku 4.5 --- src/mock_vws/_flask_server/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mock_vws/_flask_server/Dockerfile b/src/mock_vws/_flask_server/Dockerfile index 0d23b65d4..bbae92ccc 100644 --- a/src/mock_vws/_flask_server/Dockerfile +++ b/src/mock_vws/_flask_server/Dockerfile @@ -1,5 +1,4 @@ -FROM debian:bookworm-slim AS base -COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /uvx /bin/ +FROM ghcr.io/astral-sh/uv:0.10.4-python3.13-trixie-slim AS base # We set this pretend version as we do not have Git in our path, and we do # not care enough about having the version correct inside the Docker container # to install it.