From 8d43d549525549d87ccfe25a32b22d108968bd69 Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Mon, 29 Jun 2026 20:53:38 -0500 Subject: [PATCH] chore: add Docker Compose dev environment for HA testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker-compose.yml: - Uses ghcr.io/home-assistant/home-assistant:stable - network_mode: host (required for DTLS/UDP to reach LAN appliances) - custom_components/localthings mounted read-only into /config/custom_components/ - ha_config/ volume for persistent HA state ha_config/configuration.yaml: - Minimal config (frontend, http, logger) - localthings logged at DEBUG, everything else at warning ha_config/ gitignored — contains auth tokens and secrets after onboarding --- .gitignore | 3 +++ docker-compose.yml | 35 +++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index ee1c255..8952c34 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,6 @@ local-tools/ # Claude Code per-project state (permissions allowlist, etc.) .claude/ + +# HA dev instance — persisted config and secrets +ha_config/ diff --git a/docker-compose.yml b/docker-compose.yml index 769bb08..b935434 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,19 @@ services: - smartthings-local: - build: . - container_name: smartthings-local - restart: unless-stopped - - # Bridge is outbound-only (DTLS UDP to each appliance, MQTT to the - # broker on 1883). No ports to expose. - + homeassistant: + image: ghcr.io/home-assistant/home-assistant:stable + container_name: localthings-ha + # host networking is required — DTLS runs over UDP and won't + # traverse Docker's bridge NAT to reach LAN appliances. + network_mode: host volumes: - # Holds the client cert + key. APPDATA_DIR comes from .env; - # on Unraid this is typically /mnt/user/appdata/smartthings-local/. - # Bare-metal dev falls back to ./certs alongside this compose file. - - ${APPDATA_DIR:-./certs}:/config:ro - - # All runtime config is in .env. env_file passes every variable - # straight into the container, so adding a new appliance is a - # .env edit only — no compose change. - env_file: - - .env + - ./ha_config:/config + - ./custom_components/localthings:/config/custom_components/localthings:ro + environment: + - TZ=America/Chicago + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8123/"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 60s