1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 11:58:47 +00:00
dockerfiles/node-red/README.md

92 lines
1.9 KiB
Markdown
Raw Normal View History

2016-01-08 04:16:00 +00:00
node-red
========
2015-12-04 09:49:45 +00:00
2021-12-09 10:11:29 +00:00
> :warning: THIS PROJECT WAS MOVED TO: https://github.com/EasyPi/docker-node-red
<img src="https://nodered.org/about/resources/media/node-red-icon-2.png" width="100">
2015-12-04 09:49:45 +00:00
[Node-RED][1] is a tool for wiring together hardware devices, APIs and online
services in new and interesting ways.
2016-08-22 05:51:06 +00:00
![](screenshot.png)
2015-12-04 11:13:13 +00:00
## directory tree
> The `data` directory will be created after first running.
2015-12-04 11:13:13 +00:00
```
~./node-red/
2015-12-04 11:13:13 +00:00
├── docker-compose.yml
2019-03-13 05:38:16 +00:00
└── data/
2015-12-04 11:13:13 +00:00
├── flows_cred.json
├── flows.json
├── lib/
│ └── flows
└── settings.js
```
> The `arm` directory is only needed for ARM deployments, delete it if
> you are not using `arm`.
2015-12-04 11:13:13 +00:00
## docker-compose.yml
2016-09-22 03:40:47 +00:00
```yaml
2016-01-08 04:16:00 +00:00
node-red:
image: vimagick/node-red
2015-12-04 11:13:13 +00:00
ports:
- "1880:1880"
volumes:
2019-03-13 05:38:16 +00:00
- ./data:/data
2015-12-04 11:13:13 +00:00
restart: always
```
## set-up
2015-12-04 11:23:58 +00:00
Copy only the `docker-compose.yml` to your desired installation folder.
And follow these steps:
2015-12-04 11:13:13 +00:00
2019-03-16 08:37:35 +00:00
```bash
2015-12-04 11:13:13 +00:00
$ docker-compose up -d
2019-03-16 08:37:35 +00:00
2016-09-24 00:49:48 +00:00
$ docker-compose exec node-red node-red-admin hash-pw
2019-03-16 08:37:35 +00:00
>>> Password: ******
... $2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.
# Uncomment the adminAuth section and add your hashed password
$ sudo vi data/settings.js
2019-03-16 08:37:35 +00:00
2016-08-22 11:54:36 +00:00
$ docker-compose exec node-red bash
2019-03-13 05:38:16 +00:00
>>> cd /data
2016-08-22 11:54:36 +00:00
>>> apk add -U build-base
>>> npm install node-red-node-irc
>>> npm install node-red-node-daemon
>>> exit
2019-03-16 08:37:35 +00:00
2015-12-04 11:13:13 +00:00
$ docker-compose restart
```
2016-08-22 11:54:36 +00:00
> Install nodes from [node-red-nodes](https://github.com/node-red/node-red-nodes).
2015-12-04 09:49:45 +00:00
[1]: http://nodered.org/
## settings.js
```javascript
module.exports = {
...
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "ADD_HERE_YOUR_HASH_PASSWORD",
permissions: "*"
}],
default: {
permissions: "read"
}
},
...
}
```
> Password hash can be generated by running `node-red-admin hash-pw`
> <https://nodered.org/docs/security>