Commit 02aeadc1 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix entrypoint: ensure APP_KEY= line exists, remove missing command

- key:generate needs an APP_KEY= line in .env to write to (even empty)
- Replace el-captain:setup (doesn't exist) with db:seed
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 718e4270
......@@ -19,6 +19,11 @@ chmod -R 775 storage bootstrap/cache
: > .env
env | grep -E "^(APP_|DB_|LOG_|SESSION_|CACHE_|QUEUE_|FILESYSTEM_|BROADCAST_|MAIL_|TRUSTED_|BCRYPT_|PLATFORM_|ADMIN_|ACADEMY_|RUN_)" | sort | sed 's/=\(.*\)/="\1"/' >> .env
# Ensure APP_KEY line exists (key:generate needs it to write to)
if ! grep -q '^APP_KEY=' .env 2>/dev/null; then
echo 'APP_KEY=""' >> .env
fi
# Auto-generate APP_KEY if not set
if ! grep -q '^APP_KEY="base64:' .env 2>/dev/null; then
echo "==> Generating APP_KEY..."
......@@ -41,13 +46,8 @@ php artisan migrate --force --no-interaction
# First-deploy seeding (one-click install)
if [ "$RUN_SEED_ON_FIRST_DEPLOY" = "true" ]; then
# Check if organizations table is empty (fresh install)
ACADEMY_COUNT=$(php artisan tinker --execute="echo \App\Domain\Shared\Models\Academy::count();" 2>/dev/null | tail -1)
if [ "$ACADEMY_COUNT" = "0" ] || [ -z "$ACADEMY_COUNT" ]; then
echo "==> Fresh install detected. Running initial setup..."
php artisan el-captain:setup --no-interaction
echo "==> Initial setup complete."
fi
echo "==> Running database seeder..."
php artisan db:seed --force --no-interaction 2>/dev/null || true
fi
# Publish Livewire assets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment