#!/bin/sh set -e php /app/artisan migrate --force php /app/artisan storage:link # Generate only if no key is set in env or config if [ -z "$APP_KEY" ]; then echo "Generating APP_KEY..." php /app/artisan key:generate --force fi php /app/artisan config:clear php /app/artisan config:cache php /app/artisan view:cache # Execute hook script if it exists if [ -f "/app/hook.sh" ]; then echo "Executing application hook script..." chmod +x /app/hook.sh /app/hook.sh fi # Start supervisor services if enabled if [ "$ENABLE_QUEUE_WORKER" = "true" ]; then echo "Enabling Laravel queue worker..." supervisorctl -c /etc/supervisor/conf.d/supervisord.conf update laravel-queue supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start laravel-queue:* fi if [ "$ENABLE_SCHEDULER" = "true" ]; then echo "Enabling Laravel scheduler..." supervisorctl -c /etc/supervisor/conf.d/supervisord.conf update laravel-scheduler supervisorctl -c /etc/supervisor/conf.d/supervisord.conf start laravel-scheduler:* fi # Start supervisor if any services are enabled if [ "$ENABLE_QUEUE_WORKER" = "true" ] || [ "$ENABLE_SCHEDULER" = "true" ]; then echo "Starting supervisor..." /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & fi # exec php /app/artisan octane:frankenphp exec php /app/artisan octane:start --server=frankenphp --host=0.0.0.0 --admin-port=2019 --port=8000