feat: Auto-seed admin user on container start
- prestart.sh: runs seed_admin.py after migrations - seed_admin.py: reads ADMIN_EMAIL and ADMIN_PASSWORD from env vars - Creates default tenant + admin role + admin user if not exists
This commit is contained in:
@@ -100,6 +100,9 @@ asyncio.run(set_password())
|
||||
"
|
||||
fi
|
||||
|
||||
echo "[prestart] Seeding admin user if not exists..."
|
||||
python3 /app/scripts/seed_admin.py || echo "[prestart] WARNING: Admin seed failed (may already exist)"
|
||||
|
||||
echo "[prestart] Starting uvicorn on 0.0.0.0:8000 (workers=1)..."
|
||||
exec uvicorn app.main:app \
|
||||
--host 0.0.0.0 \
|
||||
|
||||
Reference in New Issue
Block a user