Discover Datum container IP at runtime

This commit is contained in:
Dorian
2026-05-09 16:33:45 +01:00
parent f2665d28c8
commit 87e114a2aa
5 changed files with 96 additions and 34 deletions

View File

@@ -1,7 +1,7 @@
# gashboard — deploy as a Portainer Stack on the same Umbrel host that runs Datum.
#
# Join Datum's app network so the API can reach Datum by its stable Compose
# service DNS name instead of a changing container IP.
# Uses the Docker socket to discover Datum's current IP on Umbrel's shared
# Docker network, avoiding stale hard-coded container IPs.
services:
gashboard:
@@ -21,9 +21,11 @@ services:
PORT: "1337"
LOG_LEVEL: "${LOG_LEVEL:-info}"
CORS_ORIGIN: "${CORS_ORIGIN:-}"
# Reach the Datum gateway container through Docker DNS on Datum's app
# network. This avoids hard-coding Datum's changing container IP.
DATUM_URL: "${DATUM_URL:-http://datum:21000}"
# Fallback URL. With DATUM_DOCKER_* set below, the API resolves Datum's
# current container IP before polling.
DATUM_URL: "${DATUM_URL:-http://datum_datum_1:21000}"
DATUM_DOCKER_CONTAINER: "${DATUM_DOCKER_CONTAINER:-datum_datum_1}"
DATUM_DOCKER_NETWORK: "${DATUM_DOCKER_NETWORK:-umbrel_main_network}"
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}"
@@ -31,17 +33,13 @@ services:
NOSTR_ALLOWED_NPUBS: "${NOSTR_ALLOWED_NPUBS?must be set}"
JWT_SECRET: "${JWT_SECRET?must be set}"
JWT_TTL_SECONDS: "${JWT_TTL_SECONDS:-86400}"
ports:
- "${PORT:-1337}:1337"
networks:
- datum_default
network_mode: host
user: "0:0"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:1337/healthz"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
networks:
datum_default:
external: true