fix: prefer NODE_IP env var in getLocalIp() for Docker deployments
This commit is contained in:
parent
a926da1c30
commit
a4b9b5be82
1 changed files with 4 additions and 0 deletions
|
|
@ -109,6 +109,10 @@ await loadS3ConfigFromDb();
|
|||
// ── Cluster self-heartbeat ────────────────────────────────────────────────────
|
||||
// Registers this node in cluster_nodes every 30 s so the Cluster page shows it.
|
||||
function getLocalIp() {
|
||||
// Prefer an explicit override — useful when running inside Docker where
|
||||
// os.networkInterfaces() returns container bridge IPs, not the host LAN IP.
|
||||
if (process.env.NODE_IP) return process.env.NODE_IP;
|
||||
|
||||
const ifaces = os.networkInterfaces();
|
||||
for (const name of Object.keys(ifaces)) {
|
||||
for (const iface of (ifaces[name] || [])) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue