Skip to content

Commit 5343006

Browse files
committed
fix(demo): let compose demo use the default throwaway DB so restarts reseed
Passing --db /tmp/cmdb-demo.db made the compose demo look like a user-supplied database, so the wipe guard refused to reseed when a stopped demo container was restarted with /tmp intact. That path is already the in-container default — drop --db and CMDB_DB_PATH so the default-path auto-wipe applies. Verified: container run → stop → start reseeds and serves, no refusal. Reported by codex review on PR #6.
1 parent 47bb4f4 commit 5343006

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

docker-compose.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ services:
1919

2020
# Demo mode: a populated fictional fleet, no setup required.
2121
# docker compose --profile demo up cmdb-demo
22-
# Uses its own DB path (/tmp/cmdb-demo.db, in-container only — not the
23-
# ./data volume) so it can never touch a real cmdb.db.
22+
# No --db / CMDB_DB_PATH here: `cmdb demo` defaults to <tempdir>/cmdb-demo.db
23+
# (in-container /tmp, not the ./data volume) and auto-wipes only that default
24+
# path — so restarts reseed cleanly and a real cmdb.db is never touchable.
2425
cmdb-demo:
2526
build: .
2627
profiles: ["demo"]
2728
ports:
2829
- "8080:8080"
29-
environment:
30-
- CMDB_DB_PATH=/tmp/cmdb-demo.db
31-
entrypoint: ["uv", "run", "cmdb", "demo", "--host", "0.0.0.0", "--db", "/tmp/cmdb-demo.db"]
30+
entrypoint: ["uv", "run", "cmdb", "demo", "--host", "0.0.0.0"]

0 commit comments

Comments
 (0)