From f70e5048bc2df350e9f0d1093378e846f0749654 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 29 Oct 2026 12:55:28 +0000 Subject: [PATCH] Run container images from installed distributions --- server/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index 73a239312..5a0cbad20 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/astral-sh/uv:0.13.1-python3.15-trixie-slim AS base +FROM ghcr.io/astral-sh/uv:0.13.1-python3.15-trixie-slim AS runtime # 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. @@ -18,12 +18,17 @@ ENV UV_PROJECT_ENVIRONMENT=/app/docker_venvs/.venv ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH" WORKDIR /app + +FROM runtime AS builder # Install the locked dependencies before copying the source, so that # source edits do not invalidate the dependency layer. COPY --chown=10001:10001 pyproject.toml uv.lock /app/ RUN uv sync --frozen --no-cache --no-dev --extra server --no-install-workspace COPY --chown=10001:10001 . /app -RUN uv sync --locked --no-cache --no-dev --extra server +RUN uv sync --locked --no-cache --no-dev --extra server --no-editable + +FROM runtime AS base +COPY --from=builder --chown=10001:10001 /app/docker_venvs/.venv /app/docker_venvs/.venv EXPOSE 5000 ENTRYPOINT ["python"] HEALTHCHECK --interval=1s --timeout=10s --start-period=5s --retries=3 CMD ["python", "-m", "vws_mock_server.healthcheck"]