Running a Python script in Node-RED results in [Errno 2] No such file or directory
The path is not correct, because it does not exist inside the container.
The point of containers is to isolate the application from the host machine (so it runs with a known set of dependent libraries and settings).
If you want to run the python file you will need to mount it into the container. e.g.
docker run -d -p 1880:1880 -v /home/pi/docker/nodered/data/python/bins.py:/data/bins.py nodered/node-red
You would then use the path /data/bins.py to point to the file in the exec node.
If you have already mounted the /home/pi/docker/nodered/data into the container on /data then the same path would be used in the exec node without the need to the extra -v /home/pi/docker/nodered/data/python/bins.py:/data/bins.py to the command line.
docker run -d -p 1880:1880 -v /home/pi/docker/nodered/data:/data nodered/node-red
Path would be /data/python/bins.py
The important thing to know is what the path is INSIDE the container, not on the host.
Read more here: Source link
