NodeRED es la herramienta ideal para gestionar la lógica de nuestros proyectos. Recolectar datos de sensores y otros dispositivos, procesarlos y enviarlos hacia la BBDD u otros servicios centrales ya sea en local o en la nube.
Directorio
/docker-data/node-red
/docker-data/node-red/data
drwxr-xr-x 3 1000 1000 4096 Mar 24 14:15 datamkdir -p /docker-data/node-red/data
chown 1000.1000 /docker-data/node-red/data/docker/node-red/docker-compose.yml
version: "3.7"
services:
node-red:
container_name: node-red
image: nodered/node-red:latest
environment:
- TZ=Europe/Madrid
volumes:
- /dev:/host/dev
- /etc/localtime:/etc/localtime:ro
- ./data:/data
network_mode: host
healthcheck:
test: ["CMD-SHELL","node /healthcheck.js"]
interval: 60s
timeout: 3s
retries: 3
start_period: 30s
restart: unless-stopped
privileged: trueAñadir usuario para acceder a Node-Red
Crear un nuevo password
docker run -it --rm --entrypoint /bin/sh nodered/node-red
node -e "console.log(require('bcryptjs').hashSync(process.argv[1], 8));" your-password-here
exit/docker-data/data/settings.js
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "$2b$08$HaTrfkNeGlpFwOShiFL3V.49VzdgGXdNqRe7hO1Omh/LbsjTP0x16",
permissions: "*"
}]
},Habilitar proyectos en node-red
/docker-data/data/settings.js
// Customising the editor
editorTheme: {
projects: {
// To enable the Projects feature, set this value to true
enabled: true
}
}Personalizar NodeRED
/docker-data/data/settings.js
editorTheme: {
page: {
title: "i40sys flows"
},
header: {
title: "Industry 4.0 Systems - Flows",
image: "", // or null to remove image
url: "http://nodered.org" // optional url to make the header text/image a link to this url
},
projects: {
// To enable the Projects feature, set this value to true
enabled: true
}
}
