From 4ffe9965e037eb930b70fa132602d77e22ee58ba Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 13 Oct 2026 16:09:23 +1100 Subject: [PATCH] fix(ops): external NATS needs a token and publishes monitoring on loopback only Issue: archie-core-ov11 --- docker-compose.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3fede36f5..01ecc259f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,10 +44,18 @@ services: # ── NATS JetStream ──────────────────────────────────────────────── nats: image: nats:2.14-alpine3.22 - command: -js -m 8222 + # The client port is published on every interface (agent containers reach + # it over the bridge), so it refuses to start without a token. Set + # NATS_TOKEN here and name the same value in [nats] token_env. + entrypoint: + - sh + - -c + - '[ -n "$$NATS_TOKEN" ] || { echo "NATS_TOKEN is required" >&2; exit 1; }; exec nats-server -js -m 8222 --auth "$$NATS_TOKEN"' + environment: + NATS_TOKEN: ${NATS_TOKEN:-} ports: - "4222:4222" # client - - "8222:8222" # monitoring (http://localhost:8222) + - "127.0.0.1:8222:8222" # monitoring (http://localhost:8222) volumes: - nats_data:/data restart: unless-stopped