Search code examples
dockerdocker-composenode-reddocker-volume

How to configure Node-RED Docker to write output files into the "data" directory?


I use node-red with docker with a docker-compose file (https://github.com/node-red/node-red-docker)

When I write a file from a flow (with node-red:file) the file is written into the container in this directory :

/usr/src/node-red

In my docker-compose file I use a volume to make data persistent

    volumes:
      - /local/path/to/node-red/data:/data

So when I write a file from a flow I would like to write the file outside the container in the same directory where all other users data are stored :

/local/path/to/node-red/data

Any help would be appreciated...


Solution

  • When you configure the file node, use the full path name of the file you want it to write - start it with /data . Otherwise it defaults to the working directory of the Node-RED process.