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

1.2 KiB

State Hub Container Image

The State Hub production image is built from state-hub/Dockerfile.

Build

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:

DATABASE_URL=postgresql+asyncpg://USER:PASSWORD@HOST:5432/DB
API_BASE=http://127.0.0.1:8000

The container starts:

uvicorn api.main:app --host 0.0.0.0 --port 8000

It includes Alembic migrations and can run migrations with:

docker run --rm --env DATABASE_URL=... state-hub:local alembic upgrade head

Verification

After start, check:

curl http://127.0.0.1:8000/state/health

Expected response:

{"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.