Call uv by full path in single RUN layer

The install script doesn't modify PATH for the shell. Call uv via
full path (/root/.local/bin/uv) in the same RUN so there's no
layer boundary issue.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-08-04 21:50:26 +03:30
parent 47fa0229b3
commit 040e57c3c0
+6 -6
View File
@@ -67,12 +67,12 @@ 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 deps natively so the venv targets this image's Python # Install uv, then build deps natively so the venv targets this image's Python
# (Playwright Noble ships uv via entrypoint shim but not in PATH) # (Playwright Noble ships Python but not uv or pip)
RUN curl -LsSf https://astral.sh/uv/install.sh | sh 2>&1 RUN mkdir -p /root/.local/bin \
ENV PATH="/root/.local/bin:$PATH" && 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 \
RUN 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 . .