From 6437ac112c59a6772bade7bafe918b8287a841a2 Mon Sep 17 00:00:00 2001 From: ayrisdev Date: Tue, 14 Jul 2026 00:15:13 +0300 Subject: [PATCH] Fix container crash: skip route:cache (app has Closure routes), make entrypoint tolerant Co-Authored-By: Claude Opus 4.8 --- docker/entrypoint.d/99-laravel-init.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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