Skip to content

Fix Docker layer caching in Dockerfile#3

Merged
samppanja merged 2 commits intomodernizefrom
copilot/sub-pr-2
Mar 10, 2026
Merged

Fix Docker layer caching in Dockerfile#3
samppanja merged 2 commits intomodernizefrom
copilot/sub-pr-2

Conversation

Copy link

Copilot AI commented Mar 10, 2026

COPY . /app before dependency installation meant any source change invalidated the uv sync cache layer, forcing a full reinstall on every rebuild.

Changes

  • Split the RUN step: system packages + uv install no longer chained with uv sync
  • Copy only pyproject.toml and uv.lock before running uv sync --no-dev --frozen
  • COPY . /app moved to after dependency installation
RUN apt-get update && apt-get install -y curl ca-certificates libmagic1 \
    && curl -LsSf https://astral.sh/uv/install.sh | sh \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml uv.lock ./
RUN uv sync --no-dev --frozen

COPY . /app

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: samppanja <21281919+samppanja@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on the 'Modernize' pull request Fix Docker layer caching in Dockerfile Mar 10, 2026
@samppanja samppanja marked this pull request as ready for review March 10, 2026 18:22
@samppanja samppanja merged commit 8b78365 into modernize Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants