1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00
dockerfiles/node-red/README.md

87 lines
1.6 KiB
Markdown
Raw Normal View History

2016-01-08 06:16:00 +02:00
node-red
========
2015-12-04 11:49:45 +02:00
2016-01-08 06:16:00 +02:00
![](https://badge.imagelayers.io/vimagick/node-red:latest.svg)
2015-12-04 11:49:45 +02:00
[Node-RED][1] is a tool for wiring together hardware devices, APIs and online
services in new and interesting ways.
2016-08-22 07:51:06 +02:00
![](screenshot.png)
2015-12-04 13:13:13 +02:00
## directory tree
```
2016-01-08 06:16:00 +02:00
~/fig/node-red/
2015-12-04 13:13:13 +02:00
├── 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
2016-09-22 05:40:47 +02:00
```yaml
2016-01-08 06:16:00 +02:00
node-red:
image: vimagick/node-red
2015-12-04 13:13:13 +02:00
ports:
- "1880:1880"
volumes:
2016-09-22 05:40:47 +02:00
- ./data:/root/.node-red
2015-12-04 13:13:13 +02:00
restart: always
```
## settings.js
2016-09-22 05:40:47 +02:00
```javascript
2015-12-04 13:13:13 +02:00
module.exports = {
//...
flowFile: 'flows.json',
//...
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.",
permissions: "*"
2016-09-24 02:49:48 +02:00
}],
default: {
permissions: "read"
}
2015-12-04 13:13:13 +02:00
},
//...
}
```
2016-09-24 02:49:48 +02:00
> Password hash can be generated by running `node-red-admin hash-pw`.
2015-12-04 13:23:58 +02:00
2015-12-04 13:13:13 +02:00
## up and running
```
2016-01-08 06:16:00 +02:00
$ cd ~/fig/node-red/
2015-12-04 13:13:13 +02:00
$ docker-compose up -d
2016-09-24 02:49:48 +02:00
$ docker-compose exec node-red node-red-admin hash-pw
2016-09-22 05:40:47 +02:00
$ vi data/settings.js
2016-08-22 13:54:36 +02:00
$ 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
2015-12-04 13:13:13 +02:00
$ docker-compose restart
```
2016-08-22 13:54:36 +02:00
> Install nodes from [node-red-nodes](https://github.com/node-red/node-red-nodes).
2015-12-04 11:49:45 +02:00
[1]: http://nodered.org/