1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:36 +02:00
dockerfiles/node-red
2016-08-23 09:03:49 +08:00
..
arm node-red with nodejs-tls 2016-08-23 09:03:49 +08:00
docker-compose.yml upgrade moodle to 3.1 2016-07-08 20:46:26 +08:00
Dockerfile node-red with nodejs-tls 2016-08-23 09:03:49 +08:00
README.md node-red-dashboard 2016-08-22 19:54:36 +08:00
screenshot.png add new screenshot.png 2016-08-22 14:11:25 +08:00

node-red

Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways.

directory tree

~/fig/node-red/
├── docker-compose.yml
└── node-red/
    ├── flows_cred.json
    ├── flows.json
    ├── lib/
    │   └── flows
    └── settings.js

The node-red directory will be created after first running.

docker-compose.yml

node-red:
  image: vimagick/node-red
  ports:
    - "1880:1880"
  volumes:
    - ./node-red:/root/.node-red
  restart: always

settings.js

module.exports = {

    //...

    flowFile: 'flows.json',

    //...

    adminAuth: {
        type: "credentials",
        users: [{
            username: "admin",
            password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.",
            permissions: "*"
        }]
    },

    //...

}

Password hash can be generated by:

node -e "console.log(require('bcryptjs').hashSync('password', 8))"

up and running

$ cd ~/fig/node-red/
$ docker-compose up -d
$ vi node-red/settings.js
$ docker-compose exec node-red bash
>>> cd /root/.node-red
>>> apk add -U build-base
>>> npm install node-red-node-irc
>>> npm install node-red-node-daemon
>>> exit
$ docker-compose restart

Install nodes from node-red-nodes.