Skip to content

Commit 9969e81

Browse files
Use Debian base image with uv installed from official Docker image (#2952)
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 d1f5e50 commit 9969e81

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/mock_vws/_flask_server/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
FROM python:3.13-slim AS base
1+
FROM ghcr.io/astral-sh/uv:0.10.4-python3.13-trixie-slim AS base
22
# We set this pretend version as we do not have Git in our path, and we do
33
# not care enough about having the version correct inside the Docker container
44
# to install it.
55
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
66
# Avoid using root user.
7-
# This avoids having to use ``--root-user-action=ignore`` with pip.
87
RUN useradd -ms /bin/bash myuser
98
USER myuser
109
COPY --chown=myuser:myuser . /app
@@ -15,9 +14,7 @@ ENV UV_PROJECT_ENVIRONMENT=/app/docker_venvs/.venv
1514
ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH"
1615

1716
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
17+
RUN uv sync --no-cache
2118
EXPOSE 5000
2219
ENTRYPOINT ["python"]
2320
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)