Public Repository

Last pushed: a year ago
Short Description
Minimal install of node-red for Raspberry pi
Full Description

A minimal Raspberry Pi node-red

  • Forked from nieleyde/rpi-nodered
  • Works on Jessie (tested on Hypriot Will)
  • gpio & serial accesses
  • Keep your flows and library across multiple container runs

Content

  • base image : resin/rpi-raspbian

Tags

  • latest : 0.1
  • 0.2 : still testing

Get started

On your raspberry, create a folder /root/mynodered, then write:

docker run --name nodered --privileged -v /root/mynodered:/root/node-red -p 1880:1880 -d ericbenoit/rpi-nodered-mini

Then access your raspberry with your preferred browser on port 1880.

Happy logs

You may obtain the following logs (docker logs nodered)

26 Jan 13:59:20 - [info] Node-RED version: v0.13.1
26 Jan 13:59:20 - [info] Node.js  version: v4.2.1
26 Jan 13:59:20 - [info] Loading palette nodes
26 Jan 13:59:29 - [info] Settings file  : /root/.node-red/settings.js
26 Jan 13:59:29 - [info] User directory : /root/node-red/
26 Jan 13:59:29 - [info] Flows file : /root/node-red/flows.json
26 Jan 13:59:29 - [info] Creating new flow file
26 Jan 13:59:29 - [info] Starting flows
26 Jan 13:59:29 - [info] Started flows
26 Jan 13:59:29 - [info] Server now running at http://127.0.0.1:1880/

Docker file

# DOCKER-VERSION 1.0.0
FROM resin/rpi-raspbian

# install required packages, in one command
RUN apt-get update  && \
    apt-get install -y  python-dev

ENV PYTHON /usr/bin/python2

# install nodejs for rpi
RUN apt-get install -y wget && \
    wget http://node-arm.herokuapp.com/node_latest_armhf.deb && \
    dpkg -i node_latest_armhf.deb && \
    rm node_latest_armhf.deb && \
    apt-get autoremove -y wget

# install node-red
RUN apt-get install -y build-essential && \
    npm install -g --unsafe-perm  node-red && \
    apt-get autoremove -y build-essential

# install RPI.GPIO python libs
RUN apt-get install -y wget && \
     wget http://downloads.sourceforge.net/project/raspberry-gpio-python/raspbian-jessie/python-rpi.gpio_0.6.1-1~jessie_armhf.deb && \
     dpkg -i python-rpi.gpio_0.6.1-1~jessie_armhf.deb && \
     rm python-rpi.gpio_0.6.1-1~jessie_armhf.deb && \
     apt-get autoremove -y wget

WORKDIR /root/bin
RUN ln -s /usr/bin/python2 ~/bin/python
RUN ln -s /usr/bin/python2-config ~/bin/python-config
env PATH ~/bin:$PATH

# Update settings
# All containers will use the same file to store flows. You will not lose your flows when you remove then re-run a container 
RUN sed -i "/\/\/flowFile:/ i\flowFile: 'flows.json'," /usr/local/lib/node_modules/node-red/settings.js && \
    sed -i "/\/\/userDir:/ i\userDir: '\/root\/node-red\/'," /usr/local/lib/node_modules/node-red/settings.js && \
    sed -i "/\/\/nodesDir:/ i\nodesDir: '\/root\/nodes\/'," /usr/local/lib/node_modules/node-red/settings.js

# run application
EXPOSE 1880
ENTRYPOINT ["node-red-pi","-v","--max-old-space-size=128"]
Docker Pull Command
Owner
ericbenoit

Comments (0)