Files
esh-pfi-infrastructure/stacks/althing-chamber/compose.yaml
T
vh 91d5417b0b althing-chamber: scaffold deploy stack on ana-docker
Two-service compose (chamber + forseti sidecar daemon) sharing a single
SQLite store via bind-mount under /opt/docker/conf/althing-chamber/data.
eventbus.bridge_from_db is the cross-process glue — forseti's commits
reach chamber's SSE subscribers via the bridge.

Pattern matches task-board's build-on-host deploy:
  - elway playbook clones vh/althing into /opt/docker/build/
  - docker build -t althing-chamber:local . (no registry)
  - playbook uploads compose + seeds .env one-time, brings both
    services up, polls /health
  - Gitea Actions workflow lives in vh/althing; reference copy here.

Internal tooling — host port 7881 (chamber's default of 7878 collides
with task-board). LAN-direct, no Traefik. Container always listens on
8000 internally.

Scaffold will fail to bring the chamber container up healthy until
galdrabok-side commits land:
  - Dockerfile at vh/althing repo root (two-stage: uv-bookworm-slim
    build → python:3.12-slim runtime, locked per open_questions §2
    of the v1 contract).
  - GET /health endpoint on the chamber app (200, no DB read).
  - ALTHING_BIND / ALTHING_PORT env-var support in
    core.cli.chamber_serve / core.chamber.cli (env > config.yaml >
    defaults precedence).

Coordinated via althing thread 01KRMAK7RD7TP6C8DF4KXV31RT.
2026-05-14 15:54:19 -07:00

77 lines
3.3 KiB
YAML

# althing-chamber + forseti — web UI + moderator daemon for the althing
# inter-agent message bus.
#
# Two services share the althing SQLite store via a single bind-mount:
# althing-chamber — FastAPI/HTMX app (port 7881 host → 8000 container)
# althing-forseti — moderator daemon (no port; cross-process glue via the DB)
#
# eventbus.bridge_from_db is load-bearing — forseti's DB commits reach
# chamber's SSE subscribers via the bridge, not via shared memory or IPC.
# Both processes read+write the same `~/.althing/althing.db` SQLite file
# at /app/data/althing.db inside the container, backed by the host's
# /opt/docker/conf/althing-chamber/data bind-mount.
#
# Image is built on the host from the vh/althing git repo by the deploy
# playbook (`playbooks/deploy-althing-chamber.yaml`), which clones into
# /opt/docker/build/althing-chamber and runs `docker build -t
# althing-chamber:local .` before installing this compose and bringing
# both services up. No registry.
#
# Internal tooling — accessed directly at http://10.250.50.70:7881 over
# the LAN; does NOT traverse Traefik. State persists under
# /opt/docker/conf/althing-chamber/data on the host.
#
# All tunables live in .env — edit that, not this file.
services:
althing-chamber:
image: ${ALTHING_IMAGE}
container_name: althing-chamber
restart: unless-stopped
ports:
- "${ALTHING_BIND:-0.0.0.0}:${ALTHING_PORT}:8000"
environment:
# ALTHING_ROOT moves the entire ~/.althing dir; ALTHING_DB additionally
# pins the SQLite path explicitly. Both point inside the bind-mount.
- ALTHING_ROOT=/app/data
- ALTHING_DB=/app/data/althing.db
# ALTHING_BIND / ALTHING_PORT — galdrabok-side env-var precedence
# (env > config.yaml > defaults) is being added in the same cycle
# as this scaffold lands. Container always listens on 8000 internally;
# the host port mapping above is the only externally-visible knob.
- ALTHING_BIND=0.0.0.0
- ALTHING_PORT=8000
volumes:
- ${ALTHING_DATA_DIR}:/app/data
command: ["althing-chamber"]
healthcheck:
# Liveness probe — chamber's /health endpoint returns 200 with no DB
# read (true liveness, not readiness). galdrabok adds this endpoint
# in the same cycle as this scaffold; container will crashloop on
# healthcheck until that lands.
test: ["CMD-SHELL", "python -c 'import urllib.request,sys; r=urllib.request.urlopen(\"http://127.0.0.1:8000/health\",timeout=3); sys.exit(0 if r.status==200 else 1)' || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
labels:
- homepage.group=Toolchain
- homepage.name=althing chamber
- homepage.icon=mdi-bullhorn
- homepage.description=Web UI for the althing inter-agent message bus
- homepage.href=http://10.250.50.70:${ALTHING_PORT}
althing-forseti:
image: ${ALTHING_IMAGE}
container_name: althing-forseti
restart: unless-stopped
environment:
- ALTHING_ROOT=/app/data
- ALTHING_DB=/app/data/althing.db
volumes:
- ${ALTHING_DATA_DIR}:/app/data
command: ["althing-forseti"]
# No healthcheck — the forseti CLI doesn't expose one. Liveness signal
# for ops is "container hasn't exited" + chamber-side observation that
# bridge_from_db events are flowing.