5e32f82b3a
- Laravel 12 base - Filament 5 (default admin panel) - Stancl/Tenancy v3 (config + migrations only) - Spatie Permission - Octane FrankenPHP runtime - Sanctum - Dockerfile multi-stage (composer + node + frankenphp:8.4) - Entrypoint runs migrations + caches on boot - .env.example pre-completat cu hosturi interne Coolify - Health endpoint /up Repo init pentru multi-tenant SaaS pe Coolify Hetzner.
31 lines
1.0 KiB
Bash
31 lines
1.0 KiB
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
cd /app
|
|
|
|
# Ensure storage subdirs exist
|
|
mkdir -p storage/framework/{cache,sessions,views,testing} storage/logs storage/app/public bootstrap/cache
|
|
chown -R www-data:www-data storage bootstrap/cache 2>/dev/null || true
|
|
|
|
# Run migrations on first boot (idempotent)
|
|
if [ "${RUN_MIGRATIONS:-true}" = "true" ]; then
|
|
echo "[entrypoint] Running migrations..."
|
|
php artisan migrate --force --no-interaction || echo "[entrypoint] migrate failed (non-fatal)"
|
|
fi
|
|
|
|
# Production caches
|
|
if [ "${APP_ENV:-production}" = "production" ]; then
|
|
echo "[entrypoint] Caching config/routes/views..."
|
|
php artisan config:cache --no-interaction || true
|
|
php artisan route:cache --no-interaction || true
|
|
php artisan view:cache --no-interaction || true
|
|
php artisan event:cache --no-interaction || true
|
|
php artisan filament:cache-components --no-interaction || true
|
|
fi
|
|
|
|
# Storage symlink (idempotent)
|
|
php artisan storage:link --no-interaction 2>/dev/null || true
|
|
|
|
echo "[entrypoint] Starting: $@"
|
|
exec "$@"
|