# Settings.js used in docker, local vs azure

**URL:** <https://discourse.nodered.org/t/settings-js-used-in-docker-local-vs-azure/90445>\
**Category:** General\
**Tags:** docker, microsoft-azure\
**Created:** [26 August 2024 11:15 UTC](https://discourse.nodered.org/t/settings-js-used-in-docker-local-vs-azure/90445 "2024-08-26T11:15:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [26 August 2024 11:15 UTC](https://discourse.nodered.org/t/settings-js-used-in-docker-local-vs-azure/90445/1 "2024-08-26T11:15:55Z")

</div>

Getting real confused about the settings.js file, which locations it is in and where node-red expects to find it.

When I run node-red locally in docker, it uses /data/settings.js and works as expected.  
When running in azure container instance, it reports to use /usr/src/node-red/node\_modules/node-red/settings.js

I then tried back and forth to edit Dockerfile to copy settings.js to /usr/src/node-red/node\_modules/node-red/settings.js as well as other possible locations like /usr/src/node-red/settings.js and /data/settings.js

Not getting any success until it just happened to work in azure. Now it says it's using /data/settings.js, identical to how it is locally.

Why am I getting these varied results about where settings.js is supposed to be? Why did the same container use different settings.js locally than remote in azure?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 August 2024 12:19 UTC](https://discourse.nodered.org/t/settings-js-used-in-docker-local-vs-azure/90445/2 "2024-08-26T12:19:40Z")

</div>

> [@ThingsTinkerer](#):
>
> Why am I getting these varied results about where settings.js is supposed to be?

Hard to say without reviewing all operations and logs but what i can say is if you see `src/node-red/node_modules/node-red/` in the path, your looking at the wrong thing.

Typically the settings.js file is either specified by command line or its in the `-u` `userDir`. If you see `/data/settings.js` then that is fairly regular.

but the most reliable way to tell is to look in the log output of node-RED:

```auto
21/08/2024 10:22:52 [info] Welcome to Node-RED
===================

21/08/2024 10:22:52 [info] Node-RED version: v4.0.2
21/08/2024 10:22:52 [info] Node.js version: v20.15.1
21/08/2024 10:22:52 [info] Linux 5.10.205-195.804.amzn2.aarch64 arm64 LE
21/08/2024 10:22:53 [info] Loading palette nodes
21/08/2024 10:22:53 [info] FlowFuse Assistant Plugin loaded
21/08/2024 10:22:53 [info] FlowFuse HTTP Authentication Plugin loaded
21/08/2024 10:22:53 [info] FlowFuse Team Library Plugin loaded
21/08/2024 10:22:53 [info] FlowFuse Light Theme Plugin loaded
21/08/2024 10:22:53 [info] FlowFuse Dark Theme Plugin loaded
21/08/2024 10:22:54 [info] FlowFuse Metrics Plugin loaded
// 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇 👇
21/08/2024 10:22:56 [info] Settings file : /data/settings.js <<<<<<<<<<<<<<< This IS the settings file
// 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 👆 
21/08/2024 10:22:56 [info] Context store : 'memory' [module=memory]
21/08/2024 10:22:56 [info] Context store : 'persistent' [module=custom]
21/08/2024 10:22:56 [info] Server now running at http://xxxxxxxxxxx

```

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [26 August 2024 12:55 UTC](https://discourse.nodered.org/t/settings-js-used-in-docker-local-vs-azure/90445/3 "2024-08-26T12:55:03Z")

</div>

Thx, yeah that's where I finally figured out the difference. I'm using slightly customized setup of node-red docker ([GitHub - node-red/node-red-docker: Repository for all things Node-RED and Docker related](https://github.com/node-red/node-red-docker)). While simple in theory, there's quite a lot of files, scripts and lines to make this work. Ie. Dockerfile, build image bat script, then a total of 4 shell scripts to run inside the container (entrypoint.sh, install\_devtools.sh, known\_hosts.sh, remove\_native\_gpio.sh). I'm able to figure out some of it but still some parts confusing.

For example I think it's the entrypoint.sh which sets the useDir:

```auto
/usr/local/bin/node $NODE_OPTIONS node_modules/node-red/red.js --userDir /data $FLOWS "${@}" &

```

But I haven't figured out what the variables are or where they come from. Then similar start script in package.json. Feels like whenever I look for something, I find it partially in multiple places (better than not finding it at all haha).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 November 2024 12:55 UTC](https://discourse.nodered.org/t/settings-js-used-in-docker-local-vs-azure/90445/4 "2024-11-24T12:55:29Z")

</div>

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