From 1b3a3f401b867abe280c5478cce34b298acde3f4 Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 1 Apr 2026 22:18:00 +0100 Subject: [PATCH] fix: UI containers use --network host for localhost proxy access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bitcoin UI and Electrs UI proxy API calls to 127.0.0.1 services (Bitcoin RPC on 8332, backend on 5678). With port-mapped containers, 127.0.0.1 is the container's own localhost — the proxy fails and UIs show "Unable to connect to Bitcoin node". Fix: bitcoin-ui and electrs-ui use --network host (internal ports 8334 and 50002 don't conflict with host nginx on 80/443). LND UI stays port-mapped (-p 8081:80) because port 80 would conflict. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/first-boot-containers.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/first-boot-containers.sh b/scripts/first-boot-containers.sh index 35f260a2..ae50c29f 100644 --- a/scripts/first-boot-containers.sh +++ b/scripts/first-boot-containers.sh @@ -988,9 +988,12 @@ for ui in bitcoin-ui lnd-ui; do continue fi case $ui in - bitcoin-ui) PORT_ARG="-p 8334:8334"; NET_ARG="" ;; # internal nginx listens on 8334 - lnd-ui) PORT_ARG="-p 8081:80"; NET_ARG="" ;; - electrs-ui) PORT_ARG="-p 50002:50002"; NET_ARG="" ;; # internal nginx listens on 50002 + # UI containers use --network host so they can proxy to localhost services + # (Bitcoin RPC at 127.0.0.1:8332, backend at 127.0.0.1:5678) + # Internal nginx ports: bitcoin-ui=8334, electrs-ui=50002, lnd-ui=80 (mapped via nginx to 8081) + bitcoin-ui) PORT_ARG=""; NET_ARG="--network host" ;; + lnd-ui) PORT_ARG="-p 8081:80"; NET_ARG="" ;; # exception: port 80 conflicts with host nginx on host network + electrs-ui) PORT_ARG=""; NET_ARG="--network host" ;; esac CONTAINER_NAME="archy-$ui" if $DOCKER images --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | grep -q "$ui"; then