From c202eb45a0bda9e40ecc65bfa6aece8abb91c28e Mon Sep 17 00:00:00 2001 From: Emi Griffith Date: Wed, 22 Jul 2026 14:46:22 -0700 Subject: [PATCH] compose: mount appdata at /state (not /app/data) to stop shadowing the data/ package The split backend's Python package data/ lives at /app/data; mounting the appdata runtime volume there erased data/*.py and broke import at boot. Point THERMOGRAPH_DATA_DIR + the appdata mount + the singleton lock at /state, outside the code tree. Pairs with thermograph-backend paths.py making DATA_DIR/LOGS_DIR env-overridable. --- docker-compose.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a3930a9..c97fea7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -112,7 +112,11 @@ services: WORKERS: ${WORKERS:-4} # One worker wins this lock and runs the subscription notifier / homepage # sweep; it lives on the appdata volume so it's shared across workers. - THERMOGRAPH_SINGLETON_LOCK: /app/data/notifier.lock + THERMOGRAPH_DATA_DIR: /state + # notifier.lock lives in the state volume, which is now mounted at /state + # (NOT /app/data) so it never shadows the Python `data/` package -- see the + # volumes: note below and thermograph-backend paths.py. + THERMOGRAPH_SINGLETON_LOCK: /state/notifier.lock # Prod secrets live in /etc/thermograph.env: POSTGRES_PASSWORD, # THERMOGRAPH_AUTH_SECRET, THERMOGRAPH_VAPID_PRIVATE_KEY/_PUBLIC_KEY, # THERMOGRAPH_COOKIE_SECURE=1, mail/Discord keys, ... (see @@ -123,7 +127,11 @@ services: required: false volumes: # Parquet cache, notifier.lock, homepage.json, vapid.json persist here. - - appdata:/app/data + # /state, NOT /app/data: after the repo split the backend's Python package + # `data/` sits at /app/data, so mounting the runtime volume there erased + # data/*.py and broke `import data.climate` at boot. THERMOGRAPH_DATA_DIR=/state + # (above) points runtime state here instead, clear of the code. + - appdata:/state - applogs:/app/logs # No compose-level healthcheck override -- the image's own Dockerfile # HEALTHCHECK (port-aware via ${PORT}) already covers this, and frontend's