Last active
March 5, 2019 00:17
-
-
Save natcl/4b0ea6b7cc33821d0c723c4b10e1781a to your computer and use it in GitHub Desktop.
Node-RED Avahi Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nodered1: | |
build: . | |
ports: | |
- "1884:1880" | |
restart: always | |
environment: | |
- TZ=America/Montreal | |
volumes: | |
- /data | |
nodered2: | |
build: . | |
ports: | |
- "1885:1880" | |
restart: always | |
environment: | |
- TZ=America/Montreal | |
volumes: | |
- /data | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nodered/node-red-docker:0.17.5 | |
USER root | |
RUN apt-get update | |
RUN apt-get install -y libavahi-compat-libdnssd-dev avahi-daemon avahi-utils | |
RUN npm install node-red-node-discovery | |
COPY start.sh / | |
ENTRYPOINT ["/start.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"4ea9b737.ddfb58","type":"announce","z":"c076df41.29509","name":"","service":"_http._tcp","port":"3000","txt":"","x":660,"y":120,"wires":[]},{"id":"5ad9fb7c.d2b22c","type":"inject","z":"c076df41.29509","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":310,"y":120,"wires":[["4ea9b737.ddfb58"]]},{"id":"783a32b7.53bcac","type":"inject","z":"c076df41.29509","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"x":310,"y":160,"wires":[["4ea9b737.ddfb58"]]}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"43a075e1.cd621c","type":"discovery","z":"c076df41.29509","name":"","topic":"","service":"_http._tcp","x":256,"y":386,"wires":[["ac2f88b5.96fb6"]]},{"id":"ac2f88b5.96fb6","type":"debug","z":"c076df41.29509","name":"","active":true,"console":"false","complete":"false","x":510,"y":380,"wires":[]}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
docker cp flows1.json noderedavahi_nodered1_1:/data/flows.json | |
docker cp flows2.json noderedavahi_nodered2_1:/data/flows.json | |
docker-compose restart nodered1 | |
docker-compose restart nodered2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf /var/run/avahi-daemon | |
rm -rf /var/run/dbus | |
mkdir -p /var/run/dbus | |
dbus-daemon --system | |
avahi-daemon --no-chroot -D | |
npm start -- --userDir /data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment