#!/bin/sh set -e # Generate app key if not set if [ -z "$APP_KEY" ]; then php artisan key:generate --force fi # Run migrations php artisan migrate --force # Create storage symlink php artisan storage:link --force 2>/dev/null || true # Cache config/routes/views for production if [ "$APP_ENV" = "production" ]; then php artisan config:cache php artisan route:cache php artisan view:cache fi # Start supervisor (nginx + php-fpm + queue + scheduler) exec supervisord -c /etc/supervisor/conf.d/supervisord.conf