browser-sec-lab/docker/php/entrypoint.sh
2026-07-03 21:38:27 +03:30

31 lines
573 B
Bash

#!/bin/bash
set -e
echo "[+] Laravel container starting..."
# .env
if [ ! -f .env ]; then
echo "[+] Creating .env"
cp .env.example .env
fi
# safety check
if [ ! -f vendor/autoload.php ]; then
echo "[❌] vendor missing! build image again"
exit 1
fi
# key generate only if not set
if ! grep -q "APP_KEY=base64" .env; then
echo "[+] Generating APP KEY"
php artisan key:generate --no-interaction
fi
# cache optimize (optional but good)
php artisan config:cache || true
php artisan route:cache || true
echo "[+] Starting PHP-FPM..."
exec php-fpm