From b827f89dcd6a002fd4a81559c9c523c9525f906f Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 6 May 2026 16:47:56 +0100 Subject: [PATCH] fix: serve SPA from apps/web/dist (matches server default) + use Datum IP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two production-blocker bugs from the first deploy: 1. Static SPA never served — Dockerfile copied apps/web/dist into apps/api/public, but server.ts default static dir resolves to apps/web/dist. Mismatch meant every route fell through to Express' bare 404 ("Cannot GET /"). Aligning Dockerfile to the default path. 2. DNS for the Datum container name failed (getaddrinfo ENOTFOUND datum_datum_1) — gashboard's Docker DNS doesn't reliably alias external-network container names across compose stacks. Switch the default DATUM_URL to the container's known IP on umbrel_main_network (10.21.0.11, captured during earlier diagnostics). If the IP changes the user can override DATUM_URL in env. If gashboard isn't actually joined to umbrel_main_network, the next failure will be a much more diagnostic ECONNREFUSED instead of an opaque ENOTFOUND. Co-Authored-By: Claude Opus 4.7 (1M context) --- .env.example | 2 +- Dockerfile | 2 +- docker-compose.yml | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 40861b6..4e38d36 100644 --- a/.env.example +++ b/.env.example @@ -16,7 +16,7 @@ LOG_LEVEL=info # Reachable internally inside Umbrel's docker network. From your LAN it's also # at http://192.168.1.191:21000 but that path goes through umbrelOS auth. # Inside the Umbrel docker network, use the Datum service hostname directly. -DATUM_URL=http://datum_datum_1:21000 +DATUM_URL=http://10.21.0.11:21000 DATUM_ADMIN_USER=admin DATUM_ADMIN_PASSWORD= # How often to scrape /clients (ms). Datum updates per-worker hashrate every diff --git a/Dockerfile b/Dockerfile index c24bc37..0c7a5a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ COPY apps/api/package.json apps/api/ RUN pnpm install --filter @gashboard/api --prod --frozen-lockfile COPY --from=build-api /app/apps/api/dist apps/api/dist -COPY --from=build-web /app/apps/web/dist apps/api/public +COPY --from=build-web /app/apps/web/dist apps/web/dist USER node EXPOSE 1337 diff --git a/docker-compose.yml b/docker-compose.yml index 74f8f9b..3204bc8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,10 @@ services: PORT: "1337" LOG_LEVEL: "${LOG_LEVEL:-info}" CORS_ORIGIN: "${CORS_ORIGIN:-}" - DATUM_URL: "${DATUM_URL:-http://datum_datum_1:21000}" + # Direct container IP from umbrel_main_network. Bypasses Docker DNS + # (which doesn't reliably alias container names across stacks). If your + # Datum container moves to a different IP, override DATUM_URL in env. + DATUM_URL: "${DATUM_URL:-http://10.21.0.11:21000}" DATUM_ADMIN_USER: "${DATUM_ADMIN_USER:-admin}" DATUM_ADMIN_PASSWORD: "${DATUM_ADMIN_PASSWORD?must be set}" DATUM_POLL_INTERVAL_MS: "${DATUM_POLL_INTERVAL_MS:-5000}"