I have some node-RED flow that I create via a Docker container, e.g., node-red-instance-1. Now I can copy the respective flows.json and flows_cred.json file from node-red-instance-1's volume mount and I wish to spin up another container e.g., node-red-instance-2 and mount the respective JSON files to the volume of the container.
Will the node-red-instance-2 be able to decrypt the flows_cred.json file and fill out the respective credentials in the flow again?
This is with an assumption that I have not set any particular key value in the settings.js.
If you haven't set your own credentialSecret in the settings file, then both instances will have generated their own key and stored it in .config.runtime.json file.
Meaning instance-2 will have a different key to instance-1 and it will not be able to decrypt.
You could copy the value from .config.runtime.json (stored as _credentialSecret) into instance-2's settings.js file.
Or just set a proper value in all of your settings file.