Hi, I am using node-red in docker container. Starting it up with --settings argument to pass on a custom settings file.
The container starts up fine but after a while it goes unhealthy and reports:
internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module '/data/settings.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/healthcheck.js:3:16) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)
as I used --settings argument the settings.js file is not in the standard /data directory. However something seem to look for it still. Any ideas on how to run with custom settings.js and don't get this message?
In order to help you understand what the problem was, so you don't hit it again, I presume you were using the --settings argument in the startup command for node-red in the container. If so and if you gave it a path to somewhere on the host file system then that wouldn't work as the container doesn't have direct access to the host file system. That is what Volumes are for, for mapping files/folders on the host file system into the container.
that is understood. I had mapped the settings file to /etc/node-red-settings/settings.js into the docker container. It started up fine but however after a while I got the message that /data/settings.js is missing.
To me that sounds like something is still looking for /data/settings.js even though I gave another path for settings.js through --settings argument.
it's possible to do it. It loads correct settings. However the healthcheck.js for docker does not like it. It looks for /data/settings.js if that file does not exist it reports unhealthy.