fix(docker): install uv via standalone installer (no system pip)
All checks were successful
tests / test (pull_request) Successful in 1m28s
tests / test (push) Successful in 1m19s

Python 3.12 from deadsnakes on Ubuntu 22.04 drops `distutils` from the
stdlib, and Ubuntu's system pip still imports from it — so `pip install`
fails immediately with ModuleNotFoundError: distutils. Switch to the uv
standalone installer, which doesn't need pip at all.

Caught during the first deploy build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dirk Riemann 2026-04-18 12:32:44 +02:00
parent a9e510362d
commit 1c31444611

View file

@ -30,7 +30,6 @@ RUN apt-get update \
python3.12 \ python3.12 \
python3.12-venv \ python3.12-venv \
python3.12-dev \ python3.12-dev \
python3-pip \
libmagic1 \ libmagic1 \
libgl1 \ libgl1 \
libglib2.0-0 \ libglib2.0-0 \
@ -40,8 +39,10 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# --- uv (dependency resolver used by the project) ----------------------- # --- uv (dependency resolver used by the project) -----------------------
RUN python -m pip install --upgrade pip \ # Install via the standalone installer; avoids needing a working system pip
&& python -m pip install "uv>=0.4" # (python3.12 on Ubuntu 22.04 has no `distutils`, which breaks Ubuntu pip).
RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
&& ln -sf /root/.local/bin/uv /usr/local/bin/uv
WORKDIR /app WORKDIR /app