Initial: Docker-Compose-Stack für Rapport Self-Hosting

Komplettes Bundle für eigene Rapport-Instanz:
- Postgres mit Supabase-Extensions + Init-Script für Standard-Rollen
- GoTrue (Auth) mit konfigurierbarem SMTP für Passwort-Reset-Mails
- PostgREST (REST-API)
- Realtime (Postgres-Changes für Live-Sync)
- Storage-API (Bilder/Quittungen)
- Kong als API-Gateway
- Rapport-Frontend als Multi-Stage-Build (zieht Sources aus dem App-Repo)

Plus:
- scripts/sync-migrations.sh: holt SQL aus dem App-Repo
- .env.example mit allen Pflicht-Secrets + optionalen SMTP-Werten
- nginx.conf mit SPA-Routing
- README mit Setup-Anleitung (Linux + macOS-Colima)
- LICENSE (AGPL-3.0)

Sync mit App-Repo: scripts/sync-migrations.sh holt die Migrations-SQL via
git clone und legt sie nach volumes/db/init/migrations/. Bei jedem
Rapport-Update erneut ausführen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 20:10:54 +02:00
commit 945e46fb03
10 changed files with 589 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/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/migrations
mkdir -p volumes/db/init/migrations
cp "$TMPDIR/app/supabase/migrations/"*.sql volumes/db/init/migrations/
COUNT=$(ls volumes/db/init/migrations/*.sql | wc -l | tr -d ' ')
echo "$COUNT Migrations nach volumes/db/init/migrations/ kopiert"
echo
echo "Nächster Schritt: docker compose up -d (oder neustart wenn schon läuft)"