Last active
March 19, 2019 10:38
-
-
Save bakman2/4dddc37ba3a08fc0133d100c6b396799 to your computer and use it in GitHub Desktop.
Node-RED docker with avahi
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: | |
nodered: | |
build: . | |
ports: | |
- "1884:1880" | |
- "5454:5353/udp" | |
restart: always | |
network_mode: host | |
environment: | |
- TZ=America/Montreal | |
volumes: | |
- /volume1/docker/node-red-docker:/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.20.2 | |
USER root | |
RUN apt-get update | |
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - | |
RUN apt-get -y install git python make g++ libavahi-compat-libdnssd-dev libnss-mdns dbus | |
RUN npm install node-red-node-discovery | |
COPY start.sh / | |
ARG AVAHI | |
RUN [ "${AVAHI:-1}" = "1" ] || (echo "Removing Avahi" && \ | |
rm -rf /etc/services.d/avahi \ | |
/etc/services.d/dbus \ | |
/etc/cont-init.d/40-dbus-avahi) | |
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
#!/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