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 ═════════════════════════════════════════════════════════════════