- deploy-vps.sh: free-warez.top → free-warez.win (eldov.win liegt auf .win, nicht .top). Vorheriger Deploy lief auf .top ohne Traefik-Routing. - docker-compose.yml: Traefik-Labels analog w-make-com (Router für eldov.win + www.eldov.win, websecure entrypoint, HTTP→HTTPS-Redirect). Service hängt am 'proxy'-Netzwerk. - next.config.ts: Rewrites als Backup zum proxy.ts (/ → /de, /projekte/[slug] → /de/projects/[slug]). In manchen Setups greift der proxy.ts nicht zuverlässig für statische Routen — doppelt hält besser. - src/app/page.tsx: Root-Route serviert DE-Inhalt direkt, damit Healthchecks und Bots eine echte Antwort bekommen (kein endloser Redirect).
41 lines
1.4 KiB
Bash
Executable File
41 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# deploy-vps.sh — Synchronisiert den eldov-win Workspace auf den VPS-Container.
|
|
# Host: free-warez.win · Container-Pfad: /opt/containers/eldov-portfolio
|
|
#
|
|
# eldov.win läuft auf demselben VPS wie w-make.com und minecraft-portal.
|
|
# Traefik routet dort die Subdomains per Docker-Labels.
|
|
#
|
|
# Voraussetzungen:
|
|
# - ssh-Zugang zu free-warez.win ist konfiguriert
|
|
# - .env.local ist lokal vorhanden (wird NICHT übertragen)
|
|
# - auf dem VPS liegt bereits ein Container namens 'eldov-portfolio'
|
|
|
|
set -euo pipefail
|
|
|
|
VPS_HOST="${VPS_HOST:-free-warez.win}"
|
|
VPS_DIR="${VPS_DIR:-/opt/containers/eldov-portfolio}"
|
|
|
|
echo "→ Prüfe SSH-Verbindung zu $VPS_HOST..."
|
|
ssh -o BatchMode=yes -o ConnectTimeout=10 "$VPS_HOST" "echo OK" >/dev/null
|
|
|
|
echo "→ Synchronisiere Quelldateien nach $VPS_HOST:$VPS_DIR"
|
|
rsync -avz --delete \
|
|
--exclude ".git" \
|
|
--exclude "node_modules" \
|
|
--exclude ".next" \
|
|
--exclude "data" \
|
|
--exclude ".env.local" \
|
|
--exclude "*.log" \
|
|
./ "$VPS_HOST:$VPS_DIR/"
|
|
|
|
echo "→ Baue und starte Container auf $VPS_HOST neu"
|
|
ssh "$VPS_HOST" "cd '$VPS_DIR' && \
|
|
[ -f .env.local ] || { echo 'FEHLT: .env.local auf dem VPS — bitte anlegen'; exit 1; } && \
|
|
docker compose build app && \
|
|
docker compose up -d app && \
|
|
docker image prune -f"
|
|
|
|
echo "✓ Deploy abgeschlossen. Healthcheck in 10 s…"
|
|
sleep 10
|
|
ssh "$VPS_HOST" "docker inspect --format='{{.State.Health.Status}}' eldov-portfolio || echo 'no healthcheck yet'"
|