app-Image: Registry-Pull mit Build-Fallback statt blindem Build

Das Frontend-Image liegt in der Gitea-Registry (karim/rapport-app:main),
also pullen wir es bevorzugt (schnell, kein npm-Build im Container) und
bauen nur aus Dockerfile.app, wenn die Registry nicht erreichbar ist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 13:38:03 +02:00
parent c17aab3d0a
commit 929c5ab600
2 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -26,7 +26,8 @@ Läuft auf der **Proxmox-VE-Host-Shell** und:
5. Generiert zufällige `POSTGRES_PASSWORD` + `JWT_SECRET` und daraus passende `ANON_KEY` / `SERVICE_ROLE_KEY`
6. Setzt `SITE_URL` / `API_EXTERNAL_URL` auf die LAN-IP des Containers
7. Holt die DB-Migrations (`sync-migrations.sh`)
8. Startet den Stack mit `docker compose up -d`
8. Holt das Frontend-Image aus der Gitea-Registry (`rapport-app:main`); falls die Registry nicht erreichbar ist, baut es als Fallback aus `Dockerfile.app`
9. Startet den Stack mit `docker compose up -d`
---
+16 -2
View File
@@ -250,8 +250,22 @@ else
msg "Migrations synchronisiert."
fi
# ═══ 9 · Stack hochfahren ═══════════════════════════════════════════════════
info "Starte Compose-Stack (Images pullen, Erststart ~1-2 Min) …"
# ═══ 9 · Frontend-Image bereitstellen (Registry-Pull, Fallback: Build) ══════
# Das `app`-Image liegt in der Gitea-Registry (git.kgva.ch/karim/rapport-app:main).
# Bevorzugt pullen — schnell, kein npm-Build im Container. Klappt der Pull nicht
# (Registry offline / nicht erreichbar / Auth), baut Dockerfile.app das Frontend
# aus RAPPORT.git als Fallback.
info "Hole Frontend-Image aus der Registry (Fallback: lokaler Build) …"
if pct exec "$CTID" -- bash -c "cd /opt/rapport && docker compose pull app" 2>/dev/null; then
msg "Frontend-Image aus Registry gezogen."
else
info "Registry-Pull fehlgeschlagen — baue aus Dockerfile.app (npm build, dauert) …"
pct exec "$CTID" -- bash -c "cd /opt/rapport && docker compose build app"
msg "Frontend-Image lokal gebaut."
fi
# ═══ 10 · Stack hochfahren ══════════════════════════════════════════════════
info "Starte Compose-Stack (Supabase-Images pullen, Erststart ~1-2 Min) …"
pct exec "$CTID" -- bash -c "cd /opt/rapport && docker compose up -d"
# ═══ Fertig ═════════════════════════════════════════════════════════════════