Switch Docker dependency installs to uv.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-09 18:33:31 +03:30
parent 2753a6e7dc
commit 526e4daa15
3 changed files with 11 additions and 6 deletions

View File

@@ -1,7 +1,10 @@
FROM python:3.14-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV UV_LINK_MODE=copy
ARG APT_MIRROR=
ARG PIP_INDEX_URL=
@@ -19,16 +22,18 @@ RUN if [ -n "$APT_MIRROR" ]; then \
fi; \
fi
# Optional PyPI mirror (pip reads these env vars)
# Optional PyPI mirror (PIP_* kept for .env compat; mapped to uv only when set)
ENV PIP_INDEX_URL=${PIP_INDEX_URL}
ENV PIP_TRUSTED_HOST=${PIP_TRUSTED_HOST}
WORKDIR /app
# Install dependencies (BuildKit pip cache survives rebuilds)
# Install dependencies (BuildKit uv cache survives rebuilds)
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/uv \
if [ -n "$PIP_INDEX_URL" ]; then export UV_DEFAULT_INDEX="$PIP_INDEX_URL"; fi; \
if [ -n "$PIP_TRUSTED_HOST" ]; then export UV_INSECURE_HOST="$PIP_TRUSTED_HOST"; fi; \
uv pip install --system -r requirements.txt
# Copy project
COPY . .