Skip to content

Commit 04082c0

Browse files
committed
build(backend): cache uv downloads in docker build
1 parent 37542cf commit 04082c0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

backend/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ RUN apt-get update && apt-get install -y \
2323
# Install uv
2424
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
2525

26+
# Keep uv artifacts across builds to avoid re-downloading large wheels.
27+
ENV UV_CACHE_DIR=/root/.cache/uv
28+
2629
# Copy workspace files
2730
COPY pyproject.toml uv.lock ./
2831
COPY apps/ apps/
@@ -33,7 +36,8 @@ COPY scripts/ scripts/
3336
RUN chmod +x scripts/*.sh 2>/dev/null || true
3437

3538
# Install dependencies
36-
RUN uv sync --all-packages --no-dev
39+
RUN --mount=type=cache,target=/root/.cache/uv \
40+
uv sync --all-packages --no-dev
3741

3842
# Expose API port
3943
EXPOSE 8000

0 commit comments

Comments
 (0)