Fix container crash: skip route:cache (app has Closure routes), make entrypoint tolerant

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 00:15:13 +03:00
co-authored by Claude Opus 4.8
parent 3f602c61ef
commit 6437ac112c
+10 -5
View File
@@ -1,6 +1,6 @@
#!/command/with-contenv bash #!/command/with-contenv bash
# Runs on every container start (after DB/Redis are reachable on the Coolify network). # 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 cd /var/www/html
@@ -10,7 +10,12 @@ php artisan storage:link 2>/dev/null || true
# Run pending migrations # Run pending migrations
php artisan migrate --force --no-interaction || true php artisan migrate --force --no-interaction || true
# Cache config/routes/views for production speed # Cache config + views for production speed
php artisan config:cache php artisan config:cache || true
php artisan route:cache php artisan view:cache || true
php artisan view:cache
# 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