https://nodered.org/docs/getting-started/docker
Creating a nodered hash if runnning nodered on docker:
docker exec -it node-red npx node-red admin hash-pw
Quickstart:
docker run -it -p 1880:1880 --name mynodered nodered/node-red docker run -d -p 1880:1880 -v /data/nodered:/data --name mynodered nodered/node-red #run in daemon mode
Trigger action if payload > 70:
var payload=msg.payload; if (payload>70) return msg;
Run
npm install node-red-dashboard
inside container, to install dashboard. Update:
npm install -g npm@8.19.2
docker-compose -f docker-compose.yml up -d
################################################################################ # Node-RED Stack or Compose ################################################################################ # docker stack deploy node-red --compose-file docker-compose-node-red.yml # docker-compose -f docker-compose-node-red.yml -p myNoderedProject up ################################################################################ version: '2' #version: "3.7" services: node-red: image: nodered/node-red:latest environment: - TZ=Europe/Berlin ports: - "1880:1880" networks: - node-red-net volumes: - /data/nodered:/data user: "0:0" restart: always volumes: node-red-data: networks: node-red-net: