chore: add Docker Compose dev environment for HA testing
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
This commit is contained in:
1 parent
cc2c1e5a1f
commit
8d43d54952
2 files changed
+20
-18
No files matched your search
@@ -36,3 +36,6 @@ local-tools/
|
|||||||
|
|
||||||
# Claude Code per-project state (permissions allowlist, etc.)
|
# Claude Code per-project state (permissions allowlist, etc.)
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
|
# HA dev instance — persisted config and secrets
|
||||||
|
ha_config/
|
||||||
+17
-18
@@ -1,20 +1,19 @@
|
|||||||
services:
|
services:
|
||||||
smartthings-local:
|
homeassistant:
|
||||||
build: .
|
image: ghcr.io/home-assistant/home-assistant:stable
|
||||||
container_name: smartthings-local
|
container_name: localthings-ha
|
||||||
restart: unless-stopped
|
# host networking is required — DTLS runs over UDP and won't
|
||||||
|
# traverse Docker's bridge NAT to reach LAN appliances.
|
||||||
# Bridge is outbound-only (DTLS UDP to each appliance, MQTT to the
|
network_mode: host
|
||||||
# broker on 1883). No ports to expose.
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
# Holds the client cert + key. APPDATA_DIR comes from .env;
|
- ./ha_config:/config
|
||||||
# on Unraid this is typically /mnt/user/appdata/smartthings-local/.
|
- ./custom_components/localthings:/config/custom_components/localthings:ro
|
||||||
# Bare-metal dev falls back to ./certs alongside this compose file.
|
environment:
|
||||||
- ${APPDATA_DIR:-./certs}:/config:ro
|
- TZ=America/Chicago
|
||||||
|
restart: unless-stopped
|
||||||
# All runtime config is in .env. env_file passes every variable
|
healthcheck:
|
||||||
# straight into the container, so adding a new appliance is a
|
test: ["CMD", "curl", "-f", "http://localhost:8123/"]
|
||||||
# .env edit only — no compose change.
|
interval: 30s
|
||||||
env_file:
|
timeout: 10s
|
||||||
- .env
|
retries: 5
|
||||||
|
start_period: 60s
|
||||||
Reference in new issue
Block a user