feat(infra): add sveltekit-base image and build-app script for Mac Mini

- Add docker/Dockerfile.sveltekit-base: pre-built base with all 34 shared
  packages (mirrors nestjs-base pattern), eliminates redundant COPY/build
  steps from individual web Dockerfiles
- Add scripts/mac-mini/build-app.sh: stops monitoring stack before build
  to free RAM, auto-restarts on exit (trap cleanup)
- Migrate todo web Dockerfile to use sveltekit-base:local (47 COPY lines
  → 2, 4 build steps → 0)
- Update CD workflow to build sveltekit-base when deploying web apps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-26 12:17:48 +01:00
parent c681a5d66a
commit cdfbfcd13e
4 changed files with 233 additions and 61 deletions

View file

@ -243,12 +243,29 @@ jobs:
done
fi
NEEDS_WEB_BASE=false
if [ "$DEPLOY_ALL" == "true" ]; then
NEEDS_WEB_BASE=true
else
for svc in $SERVICES; do
case "$svc" in *-web) NEEDS_WEB_BASE=true; break ;; esac
done
fi
if [ "$NEEDS_BASE" == "true" ]; then
echo "=== Building shared NestJS base image ==="
docker build -f docker/Dockerfile.nestjs-base -t nestjs-base:local . 2>&1 | tail -5
echo "Base image built"
echo "NestJS base image built"
else
echo "No backends to deploy, skipping base image"
echo "No backends to deploy, skipping NestJS base image"
fi
if [ "$NEEDS_WEB_BASE" == "true" ]; then
echo "=== Building shared SvelteKit base image ==="
docker build -f docker/Dockerfile.sveltekit-base -t sveltekit-base:local . 2>&1 | tail -5
echo "SvelteKit base image built"
else
echo "No web apps to deploy, skipping SvelteKit base image"
fi
- name: Build and deploy services