From 929c5ab600fa42b281fdd93149459212614219a9 Mon Sep 17 00:00:00 2001 From: karim Date: Sat, 30 May 2026 13:38:03 +0200 Subject: [PATCH] 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 --- README.md | 3 ++- rapport-lxc.sh | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6aa17d..116304a 100644 --- a/README.md +++ b/README.md @@ -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` --- diff --git a/rapport-lxc.sh b/rapport-lxc.sh index 9385e76..0aacfa8 100755 --- a/rapport-lxc.sh +++ b/rapport-lxc.sh @@ -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 ═════════════════════════════════════════════════════════════════