diff --git a/.dockerignore b/.dockerignore index 7ee04e6..3faf7a1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -26,6 +26,7 @@ wheels/ *.egg-info/ .installed.cfg *.egg +.venv/ # Web node_modules diff --git a/Dockerfile b/Dockerfile index ec4d6a8..a0d08b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,18 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv WORKDIR /app +# Pre-cache the application dependencies. +RUN --mount=type=cache,target=/root/.cache/uv \ + --mount=type=bind,source=uv.lock,target=uv.lock \ + --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + uv sync --locked --no-install-project + # Copy the application into the container. COPY . /app # Install the application dependencies. -RUN uv sync --frozen --no-cache +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync --locked EXPOSE 8000