Just try to use Environment variables then.
Works for the sftp node (top node uses domain name, bottom node uses ${SERVER}
.
Flow:
[{"id":"b9c7403504af3227","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":120,"wires":[["8b391595152c576b"]]},{"id":"8eb0fd6a7db18620","type":"debug","z":"f6f2187d.f17ca8","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1240,"y":120,"wires":[]},{"id":"3a5089d531e25ac2","type":"comment","z":"f6f2187d.f17ca8","name":"https://discourse.nodered.org/t/changing-node-configuration-using-external-methods/78380","info":"https://discourse.nodered.org/t/changing-node-configuration-using-external-methods/78380","x":980,"y":60,"wires":[]},{"id":"8b391595152c576b","type":"SFTP-main","z":"f6f2187d.f17ca8","path":"/","method":"list","remoteFilePath":"/","localFilePath":"/","remoteDestPath":"/","useCompression":"","encoding":"utf8","mode":"","recursive":"false","server":"40c9657850c479d8","x":1090,"y":120,"wires":[["8eb0fd6a7db18620"]]},{"id":"0c71767e8b0b37d7","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":920,"y":200,"wires":[["63c17f53549ba746"]]},{"id":"fb2a7a05a5030326","type":"debug","z":"f6f2187d.f17ca8","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1240,"y":200,"wires":[]},{"id":"63c17f53549ba746","type":"SFTP-main","z":"f6f2187d.f17ca8","path":"/","method":"list","remoteFilePath":"/","localFilePath":"/","remoteDestPath":"/","useCompression":"","encoding":"utf8","mode":"","recursive":"false","server":"40c9657850c479d8","x":1090,"y":200,"wires":[["fb2a7a05a5030326"]]},{"id":"40c9657850c479d8","type":"SFTP-credentials","host":"${SERVER}","port":"22","username":"demo","password":"password"}]
Defined in docker like this:
version: '3'
services:
nodered:
image: nodered/node-red
environment:
- TZ=Europe/Berlin
- SERVER=194.108.117.16
dns:
- 1.1.1.1
- 8.8.8.8
ports:
- 1880
restart: always
volumes:
- /data