From 3e4653fdb2e64c88729160295c7cb773927ee454 Mon Sep 17 00:00:00 2001 From: feco Date: Mon, 23 Nov 2026 21:54:27 +0000 Subject: [PATCH] Docker build cache: keep the frontend's node_modules out of Rust builds The Rust images build from the repository root, and every build copied services/frontend/node_modules and .next (about 1 GB) into a new layer; the CI runner's disk filled within a day. They are ignored now (a crate still includes the tarot deck from services/frontend/src/content). The CI clean-up pruned with --max-used-space, which deletes nothing with the containerd image store; it prunes by age (72 hours) instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL --- .dockerignore | 5 +++++ .gitea/workflows/ci.yml | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 639a584..e48dc52 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,3 +5,8 @@ vendor/ legacy/ .git/ **/*.md +# The frontend builds from its own folder (with its own .dockerignore). The +# Rust images use only its src/content (a crate includes the tarot deck), so +# its dependencies and build output stay out: about 1 GB in every image layer. +services/frontend/node_modules/ +services/frontend/.next/ diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 531f18c..f0c3030 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -136,8 +136,11 @@ jobs: docker images "$IMAGE_PREFIX-$svc" --format '{{.Repository}}:{{.Tag}}' | xargs -r docker rmi >/dev/null 2>&1 || true done docker image prune -f >/dev/null - # A size cap, not an age: a busy day builds tens of gigabytes. - docker builder prune -af --max-used-space 10GB >/dev/null || true + # By age: with the containerd image store a size cap + # (--max-used-space) prunes nothing. Rust builds no longer carry + # the frontend's node_modules (.dockerignore), so a few days of + # cache stay small; the cargo cache mounts of recent builds stay. + docker builder prune -af --filter until=72h >/dev/null || true deploy: needs: build