Node-Red on Docker

I have my Node-Red on the same Synology box as I do Home Assistant. Both are through Docker. I am having trouble getting Node-Red to mount the data folder to my Docker folder on the NAS. This way when I update Node-Red my flows.json file aren’t cleared.

Does anyone know if this is a bug, has had the same issue \been able to resolve it, or have I setup something incorrectly?

Thanks,

What is the error message?

No error message, it works, just everything is contained within the container itself. If the container is ever deleted it’ll delete the flows and nodes I installed.

I’ve been able to make a copy of the data folder within the container as a backup but that’s not a long term solution.

Export your flows, delete your container and recreate it to map your volume. Show us your run parameters/docker-compose and we can let you know if you’re missing something.

sooo…did you map your volume?

Yes. Seemed to ignore the mapping.

I’ve been using the Synology Docker gui because I couldn’t find a way to a compose file. I’ll see what I can put together.

Are you sure you mapped it to the correct location within the docker container?

My guess is no since it’s not working however I’m doing the same thing I do with the other containers I’ve got running and working without an issue.

The docker container (official docker container) puts the data in /data. Is that where you are mapping your volume?

Here’s where I want it mapped to.

image

You cannot just map it arbitrarily to /config

Map it to where it EXPECTS the data to go, which is /data

Tried /data but that will throw errors. /config is the only thing I can get to work.

but /config doesn’t exist in the image.

Please take a moment to read this:

https://hub.docker.com/r/nodered/node-red-docker/

Unless you tell the PROGRAM running where the files are, it doesn’t know to go look in /config

As flamingm0e said your sinology folder needs to point to /data in the container for mounting. What errors do u get when you have that inputted?

I’m still trying to figure out what’s different from this
docker run -it -p 1880:1880 -v /volume1/docker/nodered/data:/data --name mynodered nodered/node-red-docker:v8

vs what I was doing manually. But the above seems to work and keeps persistent data.

Thank you for help

Seriously?

You were pointing it to /config instead of /data. As we have stated, it HAS TO BE /data unless you tell it otherwise in environment variables

I tried /data along with several other / and other folders.

And before posting I tried backing into it via the GUI using the same file location and was having the same issue.

And you never shared the error messages you got with those other directories.

Trying random directories doesn’t do any good when the application is only looking at one path /data. That is the only directory you should have used, and if that wasn’t working, you should have provided some information as to what error message you were getting.