Add docker admin bootstrap for clean release

This commit is contained in:
2026-03-13 11:41:44 +03:00
parent 2aea70a0f6
commit 152f19eba2
12 changed files with 254 additions and 25 deletions

View File

@@ -141,6 +141,20 @@
---
## Phase 8: Post-Release Hardening — Admin Bootstrap in Docker
**Purpose**: Автоматизировать первичное создание администратора через runtime `.env.enterprise-clean` в offline/enterprise deployment.
- [X] T045 Add admin bootstrap env contract to `.env.enterprise-clean.example` (`INITIAL_ADMIN_CREATE`, `INITIAL_ADMIN_USERNAME`, `INITIAL_ADMIN_PASSWORD`, optional `INITIAL_ADMIN_EMAIL`)
- [X] T046 Wire admin bootstrap envs to backend runtime in `docker-compose.enterprise-clean.yml`
- [X] T047 Add backend entrypoint flow that performs idempotent admin bootstrap before app start in `docker/backend.Dockerfile` and new entrypoint script
- [X] T048 Extend admin creation script for optional email and deterministic exit behavior for existing user in `backend/src/scripts/create_admin.py`
- [X] T049 Update offline bundle packaging metadata to preserve new env contract in `scripts/build_offline_docker_bundle.sh` and bundle docs
- [X] T050 Add deployment runbook section for secure admin bootstrap and mandatory password rotation in `README.md` and `docs/installation.md`
- [X] T051 Add regression tests for container bootstrap path and create-admin idempotency in `backend/tests/scripts/` and/or service tests
---
## Dependencies & Execution Order
### Phase Dependencies