31 lines
573 B
Bash
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
|