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.
This commit is contained in:
Emi Griffith 2026-07-22 14:46:22 -07:00
parent 86c8e6905c
commit c202eb45a0

View file

@ -112,7 +112,11 @@ services:
WORKERS: ${WORKERS:-4} WORKERS: ${WORKERS:-4}
# One worker wins this lock and runs the subscription notifier / homepage # One worker wins this lock and runs the subscription notifier / homepage
# sweep; it lives on the appdata volume so it's shared across workers. # 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, # Prod secrets live in /etc/thermograph.env: POSTGRES_PASSWORD,
# THERMOGRAPH_AUTH_SECRET, THERMOGRAPH_VAPID_PRIVATE_KEY/_PUBLIC_KEY, # THERMOGRAPH_AUTH_SECRET, THERMOGRAPH_VAPID_PRIVATE_KEY/_PUBLIC_KEY,
# THERMOGRAPH_COOKIE_SECURE=1, mail/Discord keys, ... (see # THERMOGRAPH_COOKIE_SECURE=1, mail/Discord keys, ... (see
@ -123,7 +127,11 @@ services:
required: false required: false
volumes: volumes:
# Parquet cache, notifier.lock, homepage.json, vapid.json persist here. # 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 - applogs:/app/logs
# No compose-level healthcheck override -- the image's own Dockerfile # No compose-level healthcheck override -- the image's own Dockerfile
# HEALTHCHECK (port-aware via ${PORT}) already covers this, and frontend's # HEALTHCHECK (port-aware via ${PORT}) already covers this, and frontend's