Split deploy into independent poller and web stacks
Decouple the privileged hardware poller from web iterations so a web
redeploy can never recreate/restart the poller (the backplane-touching
container). Two images from one Dockerfile via build targets:
- jbod-poller: privileged producer, ships smartmontools/sg3-utils/ledmon,
Redis-only deps (~197MB)
- jbod-web: unprivileged read-only consumer (REST/UI/MQTT), no hardware
tools, no /dev (~147MB)
Two compose projects sharing Redis over host networking:
- compose.infra.yml (jbod-infra): poller + redis — stable substrate
- compose.web.yml (jbod-web): app — 'up -d --build' touches only app
build.sh builds/pushes both images; split requirements-{poller,web}.txt;
dropped the combined docker-compose.yml; .dockerignore excludes tmp/ (keeps
the venv and the mqtt.env creds out of the build context).
This commit is contained in:
15
README.md
15
README.md
@@ -45,12 +45,21 @@ apt install smartmontools sg3-utils ledmon # Debian/Ubuntu
|
||||
|
||||
## Run (docker compose)
|
||||
|
||||
Two **independent** stacks so web iterations never recreate the privileged
|
||||
poller (which touches the SAS bus). They're built as two images —
|
||||
`jbod-poller` (privileged, has the SAS/SMART tooling) and `jbod-web` (slim,
|
||||
unprivileged) — and share Redis over host networking.
|
||||
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
# 1. Infra: poller + redis — the stable substrate. Deploy once; touch deliberately.
|
||||
docker compose -f compose.infra.yml up -d
|
||||
|
||||
# 2. Web: REST/UI/MQTT — iterate freely; this only ever recreates `app`.
|
||||
docker compose -f compose.web.yml up -d --build
|
||||
```
|
||||
|
||||
Brings up `poller` (privileged), `app` (port 8000), and `redis`. To run the two
|
||||
processes by hand instead:
|
||||
Pin both images to a known-good SHA in deploy (`./build.sh` tags `:<sha>` and
|
||||
`:latest` for both). To run the two processes by hand instead:
|
||||
|
||||
```bash
|
||||
REDIS_HOST=localhost sudo -E python poller.py # producer (needs root)
|
||||
|
||||
Reference in New Issue
Block a user