Bootstrap pip via ensurepip to install uv manager

ensurepip -> pip install uv (package manager) -> uv sync. Uses
python -m pip so no system pip CLI is needed.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-08-04 21:50:52 +03:30
parent 040e57c3c0
commit c859028627
+5 -6
View File
@@ -67,12 +67,11 @@ WORKDIR /app
# Copy manifests + lockfile first (stable cache layer)
COPY pyproject.toml uv.lock* ./
# Install uv, then build deps natively so the venv targets this image's Python
# (Playwright Noble ships Python but not uv or pip)
RUN mkdir -p /root/.local/bin \
&& curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/root/.local sh \
&& /root/.local/bin/uv sync --frozen --no-dev --no-install-project \
&& ln -sf /root/.local/bin/uv /usr/local/bin/uv
# Install deps natively so the venv targets this image's Python
# (Playwright Noble ships Python but not pip/uv in PATH)
RUN python -m ensurepip --upgrade \
&& python -m pip install --no-cache-dir --break-system-packages uv==0.11.31 \
&& uv sync --frozen --no-dev --no-install-project
# Copy app code (busts cache on code changes, not deps)
COPY . .