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:
+5
-6
@@ -67,12 +67,11 @@ WORKDIR /app
|
|||||||
# Copy manifests + lockfile first (stable cache layer)
|
# Copy manifests + lockfile first (stable cache layer)
|
||||||
COPY pyproject.toml uv.lock* ./
|
COPY pyproject.toml uv.lock* ./
|
||||||
|
|
||||||
# Install uv, then build deps natively so the venv targets this image's Python
|
# Install deps natively so the venv targets this image's Python
|
||||||
# (Playwright Noble ships Python but not uv or pip)
|
# (Playwright Noble ships Python but not pip/uv in PATH)
|
||||||
RUN mkdir -p /root/.local/bin \
|
RUN python -m ensurepip --upgrade \
|
||||||
&& curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/root/.local sh \
|
&& python -m pip install --no-cache-dir --break-system-packages uv==0.11.31 \
|
||||||
&& /root/.local/bin/uv sync --frozen --no-dev --no-install-project \
|
&& uv sync --frozen --no-dev --no-install-project
|
||||||
&& ln -sf /root/.local/bin/uv /usr/local/bin/uv
|
|
||||||
|
|
||||||
# Copy app code (busts cache on code changes, not deps)
|
# Copy app code (busts cache on code changes, not deps)
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
Reference in New Issue
Block a user