Files
state-hub/docs/container-image.md

57 lines
1.2 KiB
Markdown

# State Hub Container Image
The State Hub production image is built from `state-hub/Dockerfile`.
## Build
```bash
cd state-hub
docker build -t state-hub:local .
```
The image installs runtime dependencies from `pyproject.toml` and excludes the
local editable `llm-connect` dependency. `llm-connect` is currently used by the
test suite only; the API and MCP runtime do not import it. Removing that
workstation-local path from the image keeps cluster builds reproducible.
## Runtime
Required environment:
```bash
DATABASE_URL=postgresql+asyncpg://USER:PASSWORD@HOST:5432/DB
API_BASE=http://127.0.0.1:8000
```
The container starts:
```bash
uvicorn api.main:app --host 0.0.0.0 --port 8000
```
It includes Alembic migrations and can run migrations with:
```bash
docker run --rm --env DATABASE_URL=... state-hub:local alembic upgrade head
```
## Verification
After start, check:
```bash
curl http://127.0.0.1:8000/state/health
```
Expected response:
```json
{"status":"ok","db":"connected"}
```
## Registry
The final registry target is intentionally not hardcoded yet. CUST-WP-0011
still has an open human decision for Gitea registry versus an interim external
registry.