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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user