Node-RED - A visual tool for wiring the Internet of Things
50K+
Dockerfile linkslatest, 1, 1.6, 1.6.2 (Dockerfile)
1.5, 1.5.1 (Dockerfile)
This repository holds a build definition and supporting files for building a Docker image to run Node-RED.
It is published as automated build machinedata/node-red on Docker Hub.
Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways.
Not quite:
/data - ready-to mount.Simply start Node-RED and access it via http://{HOSTNAME}:1880:
$ docker run -d -p 1880:1880 machinedata/node-red
Application data (flows and add-on modules) is being stored in /data, therefore it is recommended to bind mount a volume.
$ mkdir data
$ docker run -d \
--volume $(pwd)/data:/data \
--publish 1880:1880 \
machinedata/node-red
It is very easy to configure Node-RED via environment variables. If no config file is present, the docker-entrypoint.sh script will create one based on sane defaults and environment variables.
NODE_RED_FLOW_FILE: The file containing the flows. If not set, the image defaults flowFile to flows.json.
NODE_RED_USER_DIR: The directory where all user data is stored. This translates to userDir in settings.js. In most cases it makes sense to keep the /data default.
--
Example: Starting Node-RED with my_flow.json from the host data directory /mnt/data/nodered/:
$ mkdir -p /mnt/data/flows
$ touch /mnt/data/flows/my_flow.json
$ docker run -d \
-e NODE_RED_FLOW_FILE=my_flow.json \
-v /mnt/data/flows:/data \
-p 1880:1880 machinedata/node-red
will start Node-RED with the myflow.json flow.
Note: Node.js will also respect its own NPM_CONFIG_ variables.
The container is configured to start Node-RED with /config/settings.js as config file.
If a config file is mounted (preferably read-only), the NODE_RED_ environment variables will be ignored:
$ curl -O https://raw.githubusercontent.com/node-red/node-red/master/settings.js
$ sed -i -e "s#//userDir: '.*'#userDir: '/data'#" settings.js
$ docker run -d \
-v $(pwd)/settings.js:/config/settings.js:ro \
-p 1880:1880 machinedata/node-red
/data: Path where Node-RED's data is stored (userDir in Node-RED configuration).
Packages that are installed via the webinterface will be stored in /data/node_modules.When installing additional packages the npm installer will create a download cache under /tmp/.npm and further temp files in /tmp/.npm-*. You might want to bind mount your local temporary directory.
To change these paths you need to overwrite the NPM_CONFIG_TMP and NPM_CONFIG_CACHE environment variables.
1880: The default port where Node-RED is listening. Can be changed via $PORT environment variable.Node-RED is a project of the JS Foundation and is a creation of IBM Emerging Technology, authored by Nick O'Leary and Dave Conway-Jones. Copyright JS Foundation and other contributors, http://js.foundation/ under the Apache 2.0 license.
docker-node-red is licensed under the Apache 2.0 license, was created by Jodok Batlogg. Copyright 2016-2017 Crate.io, Inc..
Thanks for considering contributing to docker-node-red! The easiest way to contribute is either by filing an issue on Github or to fork the repository to create a pull request.
If you have any questions don't hesitate to join us on Slack.
Content type
Image
Digest
Size
84 MB
Last updated
over 9 years ago
docker pull machinedata/node-red