Files
SpiceManagementSystem/docker/entrypoint.sh
T
2026-09-12 21:22:12 +02:00

42 lines
974 B
Bash

#!/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-Verzeichnisse anlegen..."
mkdir -p storage/app/public \
storage/framework/sessions \
storage/framework/views \
storage/framework/cache/data
echo "==> Storage-Symlink anlegen..."
rm -rf public/storage
ln -sf ../storage/app/public public/storage
echo "==> Cache leeren und neu bauen..."
php artisan optimize:clear
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 "$@"