fix: prefer NODE_IP env var in getLocalIp() for Docker deployments

This commit is contained in:
Zac Gaetano 2026-05-20 16:16:09 -04:00
parent a926da1c30
commit a4b9b5be82

View file

@ -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] || [])) {