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:
Agent Zero
2026-08-04 12:21:38 +02:00
parent 4b00204b63
commit 0ebc411fd8
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -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 \