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.