#!/bin/bash set -e # Logging functions log() { local level=$1 shift { set +x; } 2> /dev/null echo "[$level] $@" } info() { log "INFO" "$@" } warning() { log "WARNING" "$@" } fatal() { log "ERROR" "$@" >&2 exit 1 } # Banner echo "" echo "***********************************************************" echo " Starting LARAVEL PHP-FPM Container " echo "***********************************************************" # Check if the artisan file exists ARTISAN_PATH="/var/www/html/artisan" if [[ -f "$ARTISAN_PATH" ]]; then info "Artisan file found, creating Laravel supervisor config..." # Create Laravel Supervisor config SUPERVISOR_TASK="/etc/supervisor/conf.d/laravel-worker.conf" cat > "$SUPERVISOR_TASK" <