perf(docker): reuse dependency layers and preserve build caches
This commit is contained in:
1 parent
31691c1c7d
commit
2840ef5d9d
4 files changed
+59
-34
No files matched your search
@@ -86,6 +86,7 @@ jobs:
|
||||
# hebben geen outbound internet (npm/pnpm zouden hangen).
|
||||
DOCKER_BUILDKIT=1 docker build \
|
||||
--network=host \
|
||||
--progress=plain \
|
||||
--build-arg NODE_OPTIONS="--max-old-space-size=1536" \
|
||||
--cache-from epicnext-cms:latest \
|
||||
-t epicnext-cms:latest .
|
||||
@@ -160,18 +161,15 @@ jobs:
|
||||
docker compose -f /var/www/atom-nexst/docker-compose.yml up -d --no-build 2>&1 || true
|
||||
exit 1
|
||||
|
||||
- name: Prune Docker cache
|
||||
- name: Prune old Docker cache
|
||||
if: always()
|
||||
run: |
|
||||
# Ruim de self-hosted runner op zodat de Docker daemon niet
|
||||
# volloopt. Draaiende containers/images (o.a. de net-deployed
|
||||
# epicnext-cms-app) worden nooit geraakt, alleen ongebruikte
|
||||
# images, build-cache, volumes en networks verdwijnen.
|
||||
docker image prune -af || true
|
||||
docker container prune -f || true
|
||||
docker volume prune -f || true
|
||||
docker network prune -f || true
|
||||
docker builder prune -af --keep-storage=2g || true
|
||||
# Keep recently used layers and cache mounts for subsequent deploys.
|
||||
# The age filter preserves the last 72 hours; keep-storage is a
|
||||
# cleanup target, not a hard limit on recent cache disk usage.
|
||||
docker builder prune -af --filter "until=72h" --keep-storage=2g || true
|
||||
# Only old dangling images; application volumes and networks persist.
|
||||
docker image prune -f --filter "until=168h" || true
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# E2E smoke against the freshly deployed container.
|
||||
|
||||
Reference in new issue
Block a user