diff --git a/docker/entrypoint.d/99-laravel-init.sh b/docker/entrypoint.d/99-laravel-init.sh index 2580965..962befd 100755 --- a/docker/entrypoint.d/99-laravel-init.sh +++ b/docker/entrypoint.d/99-laravel-init.sh @@ -1,6 +1,6 @@ #!/command/with-contenv bash # Runs on every container start (after DB/Redis are reachable on the Coolify network). -set -e +# NOTE: no `set -e` — cache warmup must never crash container startup. cd /var/www/html @@ -10,7 +10,12 @@ php artisan storage:link 2>/dev/null || true # Run pending migrations php artisan migrate --force --no-interaction || true -# Cache config/routes/views for production speed -php artisan config:cache -php artisan route:cache -php artisan view:cache +# Cache config + views for production speed +php artisan config:cache || true +php artisan view:cache || true + +# route:cache intentionally SKIPPED: app has Closure-based routes +# (routes/web.php + api.php) which Laravel cannot serialize. Refactoring +# those closures into controllers would allow enabling route:cache later. + +exit 0