#!/bin/sh set -e echo "==> Warte auf Datenbank..." until php -r " try { new PDO( 'mysql:host=' . getenv('DB_HOST') . ';port=' . getenv('DB_PORT') . ';dbname=' . getenv('DB_DATABASE'), getenv('DB_USERNAME'), getenv('DB_PASSWORD') ); exit(0); } catch (Exception \$e) { exit(1); } " 2>/dev/null; do sleep 2 done echo "==> Migrationen ausführen..." php artisan migrate --force --no-interaction echo "==> Storage-Symlink anlegen..." php artisan storage:link --force 2>/dev/null || true echo "==> Cache für Produktion bauen..." php artisan config:cache php artisan route:cache php artisan view:cache php artisan event:cache echo "==> FrankenPHP starten..." exec frankenphp run --config /app/Caddyfile "$@"