diff --git a/infra/compose.yaml b/infra/compose.yaml index e0cb182..4bc465f 100644 --- a/infra/compose.yaml +++ b/infra/compose.yaml @@ -11,11 +11,11 @@ services: - ./mosquitto/data:/mosquitto/data - ./mosquitto/log:/mosquitto/log healthcheck: - test: ["CMD", "sh", "-c", "timeout 3 mosquitto_sub -p 1883 -t healthcheck -C 1 --quiet & sleep 0.5 && mosquitto_pub -p 1883 -t healthcheck -m ok -r; wait"] - interval: 10s + test: ["CMD", "mosquitto_pub", "-p", "1883", "-t", "healthcheck", "-m", "ok", "-r", "--quiet"] + interval: 30s timeout: 5s retries: 3 - start_period: 15s + start_period: 30s zigbee2mqtt: image: ghcr.io/pine64/zigbee2mqtt:latest-dev # BLZ fork, NOT koenkk @@ -28,8 +28,11 @@ services: volumes: - ./zigbee2mqtt:/app/data devices: - - /dev/ttyUSB0:/dev/ttyUSB0 + - source: /dev/serial/by-path/platform-3f980000.usb-usb-0:1.1.2:1.0-port0 + target: /dev/ttyUSB0 + permissions: rw entrypoint: ["/app/data/scripts/entrypoint.sh"] + command: ["/sbin/tini", "--", "node", "index.js"] environment: TZ: America/Los_Angeles diff --git a/infra/zigbee2mqtt/scripts/entrypoint.sh b/infra/zigbee2mqtt/scripts/entrypoint.sh index 912fdc7..e15ba56 100755 --- a/infra/zigbee2mqtt/scripts/entrypoint.sh +++ b/infra/zigbee2mqtt/scripts/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -node /app/data/scripts/blz-bridge-patch.js +cd /app && node /app/data/scripts/blz-bridge-patch.js exec docker-entrypoint.sh "$@"