Skip to content

Commit 9e19b0b

Browse files
adamtheturtleclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 5f693b7 commit 9e19b0b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/mock_vws/_flask_server/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM python:3.13-slim AS base
1+
FROM debian:bookworm-slim AS base
2+
COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /uvx /bin/
23
# We set this pretend version as we do not have Git in our path, and we do
34
# not care enough about having the version correct inside the Docker container
45
# to install it.
56
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
67
# Avoid using root user.
7-
# This avoids having to use ``--root-user-action=ignore`` with pip.
88
RUN useradd -ms /bin/bash myuser
99
USER myuser
1010
COPY --chown=myuser:myuser . /app
@@ -15,9 +15,7 @@ ENV UV_PROJECT_ENVIRONMENT=/app/docker_venvs/.venv
1515
ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH"
1616

1717
WORKDIR /app
18-
RUN python3 -m venv $UV_PROJECT_ENVIRONMENT && \
19-
pip install --no-cache-dir uv==0.10.4 && \
20-
uv sync --no-cache
18+
RUN uv sync --no-cache
2119
EXPOSE 5000
2220
ENTRYPOINT ["python"]
2321
HEALTHCHECK --interval=1s --timeout=10s --start-period=5s --retries=3 CMD ["python", "/app/src/mock_vws/_flask_server/healthcheck.py"]

0 commit comments

Comments
 (0)