From 1e5fa4d6fa203cc3420511405fc95381af55e315 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 26 Aug 2024 20:48:40 -0500 Subject: [PATCH] Use cache mounts during `uv sync` operations (#9) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6af1ba..2800197 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,13 @@ ADD .dockerignore . WORKDIR /app ADD uv.lock /app/uv.lock ADD pyproject.toml /app/pyproject.toml -RUN uv sync --frozen --no-install-project +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --frozen --no-install-project # Then, install the rest of the project ADD . /app -RUN uv sync --frozen +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --frozen # Place executables in the environment at the front of the path ENV PATH="/app/.venv/bin:$PATH"