fb54f22e0c
- App-Image wird jetzt aus Gitea-Container-Registry gepullt (git.kgva.ch/karim/rapport-app:main) — kein lokaler Build mehr noetig. build:-Section bleibt fuer Dev-Workflow. - DB-Port nur noch auf 127.0.0.1 gebunden — kein direkter LAN-Zugriff zur Postgres mehr (Kong-Proxy ist der einzige Weg). - DB-Healthcheck: start_period 30s + 20 retries — Migrations + Schema-Init brauchen beim Erst-Start laenger als 50s. - Realtime: DB_AFTER_CONNECT_QUERY zeigt jetzt auf 'realtime' (ohne Underscore). - App-Image-HEALTHCHECK: wget http://127.0.0.1/ statt localhost (IPv6-Fall). - Init-Setup: zz-rapport-post-init.sh statt 00-init.sh, plus rapport-migrations als separater Mount unter /rapport-migrations.
31 lines
997 B
Bash
Executable File
31 lines
997 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Holt die aktuellen Postgres-Migrations aus dem RAPPORT-App-Repo.
|
|
#
|
|
# Aufruf einmal bei Setup, danach nach jedem Rapport-Update.
|
|
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
REPO_URL="${RAPPORT_REPO_URL:-https://git.kgva.ch/karim/RAPPORT}"
|
|
TAG="${RAPPORT_APP_TAG:-main}"
|
|
TMPDIR=$(mktemp -d)
|
|
trap "rm -rf $TMPDIR" EXIT
|
|
|
|
echo "→ Hole Migrations aus $REPO_URL @ $TAG"
|
|
git clone --branch "$TAG" --depth 1 --quiet "$REPO_URL" "$TMPDIR/app"
|
|
|
|
if [ ! -d "$TMPDIR/app/supabase/migrations" ]; then
|
|
echo "✗ Migrations-Verzeichnis nicht gefunden im App-Repo." >&2
|
|
exit 1
|
|
fi
|
|
|
|
rm -rf volumes/db/init/rapport-migrations
|
|
mkdir -p volumes/db/init/rapport-migrations
|
|
cp "$TMPDIR/app/supabase/migrations/"*.sql volumes/db/init/rapport-migrations/
|
|
|
|
COUNT=$(ls volumes/db/init/rapport-migrations/*.sql | wc -l | tr -d ' ')
|
|
echo "✓ $COUNT Migrations nach volumes/db/init/rapport-migrations/ kopiert"
|
|
echo
|
|
echo "Nächster Schritt: docker compose up -d (oder neustart wenn schon läuft)"
|