Docker NR & ttyUSB0 Permission denied

You can create an image that also has the node-red flows. See:

You must copy the flows_cred.json as well into your image (see link I have shared) otherwise your node-red container won't be able to run the flows.

Currently you are using a volume that is mounted to the folder /data of your node-red container and as a consequence your node-red flow files (and others) becomes stored in that volume.

Note that once your image is containing the node-red flows then you no longer need to specify this volume.

Thank you Janvda for this clarification. They are very useful to me.
I need to understand the documentation well, being new to docker. Not easy at the beginning.
I understood well now how to copy the essential files into the image.

In fact,what I want to do is to freeze the flows with my programming,
however these flows create global variables or files that are specific to each user-computer and maintained over time (and upgrade).
These are defined by the user initially according to his physical configuration and then used by the application (this one is dynamic according to the parameters).
So to summarize, the flows are fixed (my application), but the parameters defined at the launch of the application must remain on the user's computer.
The goals are, I want to update the feeds remotely, hence the idea of using docker for that.
I really appreciate your help which allows me to move forward :+1:

If you want those files to persist after an upgrade of your container with new flows then you must assure that the location of those files are mapped to a mounted docker volume.

One common approach is to use environment variables which must be set properly for the specific user environment when launching the container.

I have indeed already made the modifications so that the variables can stay outside the container (see below).
I don't use a volume pointing to /data anymore but obviously to my fixed directory. It works. That's fixed.

image

To define the environment variables, it's ok, I already use that for the Mail node which is predefined before the launch of NR.
I hesitate between a pre-filled file or environment variables.
I enjoy NR :ok_hand: and this forum too !

2 Likes

If you can easily configure it through environment variables then I would use environment variables.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.