#!/bin/sh set -e cd /app # Auto-generate APP_KEY if not provided if [ -z "$APP_KEY" ]; then echo "[entrypoint] No APP_KEY set, generating one..." APP_KEY=$(php artisan key:generate --show) export APP_KEY echo "[entrypoint] Generated APP_KEY: $APP_KEY" echo "[entrypoint] WARNING: Set this APP_KEY in your docker-compose.yml to persist across restarts!" fi # Generate PHP ini from environment variables (with defaults) echo "[entrypoint] Configuring PHP settings..." cat > /usr/local/etc/php/conf.d/99-uploads.ini <&2 exit 1 fi echo "[entrypoint] Starting Octane (FrankenPHP) with automatic HTTPS for $SERVER_NAME..." exec php artisan octane:frankenphp --host="$SERVER_NAME" --port=443 --https --http-redirect fi echo "[entrypoint] Starting Octane (FrankenPHP) on HTTP..." exec php artisan octane:frankenphp --host=0.0.0.0 --port=80