From 8e1ff7743fa0906c8012dc0fce68af5e20c2cd40 Mon Sep 17 00:00:00 2001 From: kev Date: Sun, 30 Apr 2017 21:58:14 +0800 Subject: [PATCH] update node-red --- node-red/Dockerfile | 19 +++++++++++++------ node-red/arm/Dockerfile | 6 +++--- node-red/docker-compose.yml | 2 ++ node-red/{arm => }/patch/36-rpi-gpio.js | 0 node-red/{arm => }/patch/README.md | 0 node-red/{arm => }/patch/nrgpio | 0 node-red/{arm => }/patch/nrgpio.py | 0 node-red/{arm => }/patch/screenshot.png | Bin 8 files changed, 18 insertions(+), 9 deletions(-) rename node-red/{arm => }/patch/36-rpi-gpio.js (100%) rename node-red/{arm => }/patch/README.md (100%) rename node-red/{arm => }/patch/nrgpio (100%) rename node-red/{arm => }/patch/nrgpio.py (100%) rename node-red/{arm => }/patch/screenshot.png (100%) diff --git a/node-red/Dockerfile b/node-red/Dockerfile index bcbc053..387a948 100644 --- a/node-red/Dockerfile +++ b/node-red/Dockerfile @@ -3,20 +3,27 @@ # FROM alpine -MAINTAINER kev +MAINTAINER EasyPi Software Foundation RUN set -xe \ - && apk add --no-cache bash \ - build-base \ + && apk add --no-cache build-base \ ca-certificates \ + curl \ nodejs \ - python \ - python-dev \ + python3 \ + python3-dev \ + && ln -sf /usr/bin/python3 /usr/bin/python \ + && pip3 install --no-cache-dir rpi.gpio \ + six \ && npm install -g --unsafe-perm node-red \ node-red-admin \ node-red-dashboard \ + && cd /usr/lib/node_modules/node-red/nodes/core/hardware \ + && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/patch/nrgpio > nrgpio \ + && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/patch/nrgpio.py > nrgpio.py \ + && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/patch/36-rpi-gpio.js > 36-rpi-gpio.js \ && apk del build-base \ - python-dev \ + python3-dev \ && rm -rf /tmp/npm-* WORKDIR /root/.node-red diff --git a/node-red/arm/Dockerfile b/node-red/arm/Dockerfile index cbdbb3f..c0dd38a 100644 --- a/node-red/arm/Dockerfile +++ b/node-red/arm/Dockerfile @@ -19,9 +19,9 @@ RUN set -xe \ node-red-admin \ node-red-dashboard \ && cd /usr/lib/node_modules/node-red/nodes/core/hardware \ - && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/arm/patch/nrgpio > nrgpio \ - && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/arm/patch/nrgpio.py > nrgpio.py \ - && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/arm/patch/36-rpi-gpio.js > 36-rpi-gpio.js \ + && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/patch/nrgpio > nrgpio \ + && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/patch/nrgpio.py > nrgpio.py \ + && curl -sSL https://github.com/vimagick/dockerfiles/raw/master/node-red/patch/36-rpi-gpio.js > 36-rpi-gpio.js \ && apk del build-base \ python3-dev \ && rm -rf /tmp/npm-* diff --git a/node-red/docker-compose.yml b/node-red/docker-compose.yml index 4b3a26b..2ba655f 100644 --- a/node-red/docker-compose.yml +++ b/node-red/docker-compose.yml @@ -4,4 +4,6 @@ node-red: - "1880:1880" volumes: - ./data:/root/.node-red + - /dev/input:/dev/input + privileged: yes restart: always diff --git a/node-red/arm/patch/36-rpi-gpio.js b/node-red/patch/36-rpi-gpio.js similarity index 100% rename from node-red/arm/patch/36-rpi-gpio.js rename to node-red/patch/36-rpi-gpio.js diff --git a/node-red/arm/patch/README.md b/node-red/patch/README.md similarity index 100% rename from node-red/arm/patch/README.md rename to node-red/patch/README.md diff --git a/node-red/arm/patch/nrgpio b/node-red/patch/nrgpio similarity index 100% rename from node-red/arm/patch/nrgpio rename to node-red/patch/nrgpio diff --git a/node-red/arm/patch/nrgpio.py b/node-red/patch/nrgpio.py similarity index 100% rename from node-red/arm/patch/nrgpio.py rename to node-red/patch/nrgpio.py diff --git a/node-red/arm/patch/screenshot.png b/node-red/patch/screenshot.png similarity index 100% rename from node-red/arm/patch/screenshot.png rename to node-red/patch/screenshot.png