From be802d66d70161666520309ec01ccf0c1f1b3292 Mon Sep 17 00:00:00 2001 From: Martin Bernstorff Date: Sun, 19 Nov 2023 10:02:35 +0100 Subject: [PATCH] dev: setup pip caching (#215) Auto-created --- Dockerfile | 2 +- Dockerfile.dev | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a93231b8..cd9cf85e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ WORKDIR /app # Install build utilities and python requirements COPY pyproject.toml ./ -RUN pip install --user --no-cache-dir . +RUN --mount=type=cache,target=/root/.cache/pip pip install --user . --no-compile COPY ./ ./ # Stage 2: Production diff --git a/Dockerfile.dev b/Dockerfile.dev index 26952f1b..cbb12a16 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -8,8 +8,8 @@ RUN pyright . # Install deps COPY pyproject.toml ./ -RUN pip install --upgrade .[dev] -RUN pip install --upgrade .[tests] +RUN --mount=type=cache,target=/root/.cache/pip pip install pip install --upgrade .[dev] +RUN --mount=type=cache,target=/root/.cache/pip pip install pip install --upgrade .[tests] # Ensure pyright builds correctly. # If run in make validate, it is run in parallel, which breaks its installation.