Compare commits
2 Commits
5383edd4ae
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 97c30acfdd | |||
| ba3e172dda |
+18
-5
@@ -2,7 +2,7 @@ services:
|
|||||||
mosquitto:
|
mosquitto:
|
||||||
image: eclipse-mosquitto:latest
|
image: eclipse-mosquitto:latest
|
||||||
container_name: mosquitto
|
container_name: mosquitto
|
||||||
restart: unless-stopped
|
restart: always
|
||||||
user: "1883:1883"
|
user: "1883:1883"
|
||||||
ports:
|
ports:
|
||||||
- "1883:1883"
|
- "1883:1883"
|
||||||
@@ -10,6 +10,12 @@ services:
|
|||||||
- ./mosquitto/config:/mosquitto/config
|
- ./mosquitto/config:/mosquitto/config
|
||||||
- ./mosquitto/data:/mosquitto/data
|
- ./mosquitto/data:/mosquitto/data
|
||||||
- ./mosquitto/log:/mosquitto/log
|
- ./mosquitto/log:/mosquitto/log
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mosquitto_pub", "-p", "1883", "-t", "healthcheck", "-m", "ok", "-r", "--quiet"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
zigbee2mqtt:
|
zigbee2mqtt:
|
||||||
image: ghcr.io/pine64/zigbee2mqtt:latest-dev # BLZ fork, NOT koenkk
|
image: ghcr.io/pine64/zigbee2mqtt:latest-dev # BLZ fork, NOT koenkk
|
||||||
@@ -22,7 +28,11 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./zigbee2mqtt:/app/data
|
- ./zigbee2mqtt:/app/data
|
||||||
devices:
|
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:
|
environment:
|
||||||
TZ: America/Los_Angeles
|
TZ: America/Los_Angeles
|
||||||
|
|
||||||
@@ -43,7 +53,8 @@ services:
|
|||||||
container_name: nodered
|
container_name: nodered
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- mosquitto
|
mosquitto:
|
||||||
|
condition: service_healthy
|
||||||
user: "1000:1000"
|
user: "1000:1000"
|
||||||
ports:
|
ports:
|
||||||
- "1880:1880"
|
- "1880:1880"
|
||||||
@@ -65,7 +76,8 @@ services:
|
|||||||
container_name: doorbell-listener
|
container_name: doorbell-listener
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- mosquitto
|
mosquitto:
|
||||||
|
condition: service_healthy
|
||||||
volumes:
|
volumes:
|
||||||
- ./doorbell-listener/state:/data/doorbell-listener
|
- ./doorbell-listener/state:/data/doorbell-listener
|
||||||
environment:
|
environment:
|
||||||
@@ -146,7 +158,8 @@ services:
|
|||||||
container_name: party-lock
|
container_name: party-lock
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- mosquitto
|
mosquitto:
|
||||||
|
condition: service_healthy
|
||||||
volumes:
|
volumes:
|
||||||
- ./mosquitto/config:/mosquitto/config
|
- ./mosquitto/config:/mosquitto/config
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|||||||
@@ -14,12 +14,20 @@ RUN apt-get update \
|
|||||||
libpango-1.0-0 \
|
libpango-1.0-0 \
|
||||||
libpangoft2-1.0-0 \
|
libpangoft2-1.0-0 \
|
||||||
libgirepository-1.0-1 \
|
libgirepository-1.0-1 \
|
||||||
libgirepository1.0-dev \
|
|
||||||
gir1.2-glib-2.0 \
|
gir1.2-glib-2.0 \
|
||||||
gir1.2-gstreamer-1.0 \
|
gir1.2-gstreamer-1.0 \
|
||||||
gir1.2-gst-plugins-base-1.0 \
|
gir1.2-gst-plugins-base-1.0 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
python3-gi \
|
||||||
|
python3-gi-cairo \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Expose the system Python's gi module to Python 3.12 (/usr/local).
|
||||||
|
ENV PYTHONPATH=/usr/lib/python3/dist-packages:${PYTHONPATH}
|
||||||
|
|
||||||
RUN pip install --no-cache-dir \
|
RUN pip install --no-cache-dir \
|
||||||
"setuptools<80" \
|
"setuptools<80" \
|
||||||
Mopidy==3.4.2 \
|
Mopidy==3.4.2 \
|
||||||
|
|||||||
@@ -51,7 +51,13 @@ def main():
|
|||||||
rebuild_acl()
|
rebuild_acl()
|
||||||
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||||
client.on_message = on_message
|
client.on_message = on_message
|
||||||
client.connect(MQTT_HOST, MQTT_PORT, 60)
|
while True:
|
||||||
|
try:
|
||||||
|
client.connect(MQTT_HOST, MQTT_PORT, 60)
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
print(f"mqtt connect failed: {e}; retrying in 5s", flush=True)
|
||||||
|
time.sleep(5)
|
||||||
client.subscribe("party-lock/set", qos=1)
|
client.subscribe("party-lock/set", qos=1)
|
||||||
client.loop_forever()
|
client.loop_forever()
|
||||||
|
|
||||||
|
|||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd /app && node /app/data/scripts/blz-bridge-patch.js
|
||||||
|
|
||||||
|
exec docker-entrypoint.sh "$@"
|
||||||
Reference in New Issue
Block a user