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

92 lines
1.9 KiB
Markdown

node-red
========
> :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">
[Node-RED][1] is a tool for wiring together hardware devices, APIs and online
services in new and interesting ways.
![](screenshot.png)
## directory tree
> The `data` directory will be created after first running.
```
~./node-red/
├── docker-compose.yml
└── data/
├── 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`.
## docker-compose.yml
```yaml
node-red:
image: vimagick/node-red
ports:
- "1880:1880"
volumes:
- ./data:/data
restart: always
```
## set-up
Copy only the `docker-compose.yml` to your desired installation folder.
And follow these steps:
```bash
$ docker-compose up -d
$ docker-compose exec node-red node-red-admin hash-pw
>>> Password: ******
... $2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.
# Uncomment the adminAuth section and add your hashed password
$ sudo vi data/settings.js
$ docker-compose exec node-red bash
>>> cd /data
>>> 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](https://github.com/node-red/node-red-nodes).
[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>