Skip to content

Commit e88d189

Browse files
committed
refactor: use compose variable expansion for server port mapping
- Replace static host resolution logic - Defer HOST/PORT to compose runtime - Container always binds to 0.0.0.0 - Simplifies normalize_server_host fn - Removes redundant port fallback logic
1 parent 4ce0c3d commit e88d189

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

scripts/setup/setup.sh

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -312,24 +312,10 @@ normalize_loopback_host_for_compose() {
312312
}
313313

314314
normalize_server_host_for_compose() {
315-
local host="${1:-0.0.0.0}"
316-
local publish_host="$host"
317-
local publish_port="${ENV_VALUES[PORT]:-9621}"
318-
319-
case "$publish_host" in
320-
localhost)
321-
publish_host="127.0.0.1"
322-
;;
323-
"")
324-
publish_host="0.0.0.0"
325-
;;
326-
esac
327-
328-
if [[ -z "$publish_port" ]]; then
329-
publish_port="9621"
330-
fi
331-
332-
LIGHTRAG_COMPOSE_SERVER_PORT_MAPPING="${publish_host}:${publish_port}:9621"
315+
# Keep the published bind address/port configurable through compose-time
316+
# variable expansion, while forcing the container itself to listen on the
317+
# internal service defaults.
318+
LIGHTRAG_COMPOSE_SERVER_PORT_MAPPING='${HOST:-0.0.0.0}:${PORT:-9621}:9621'
333319
NORMALIZED_SERVER_HOST_FOR_COMPOSE="0.0.0.0"
334320
}
335321

0 commit comments

Comments
 (0)