Files
SpiceManagementSystem/docker/entrypoint.sh
T
Malek TellissiandClaude Sonnet 4.6 cb7765bbcc
Deploy / deploy (push) Successful in 14s
Ensure storage directories exist before storage:link in entrypoint
The Docker volume replaces storage/app/ with an empty volume on first
run, so storage/app/public/ must be created explicitly before the
storage:link symlink is registered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-12 04:33:44 +02:00

40 lines
915 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..."
php artisan storage:link --force
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 "$@"