Skip to content

Commit 2234ad0

Browse files
feat(docker): make the core NATS bind host configurable (#1411)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6faed3b commit 2234ad0

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"hephaestus": minor
3+
---
4+
5+
The core NATS port can now be exposed beyond localhost. It stays bound to `127.0.0.1` by default;
6+
set `NATS_BIND_HOST=0.0.0.0` (or a specific interface address) to let other hosts reach the bus — for
7+
example when a separate environment consumes events from this one's JetStream.
8+
9+
**Operators:** only expose it on a trusted or firewalled network. The bus is unauthenticated, so a
10+
public bind puts its contents within reach of anyone who can route to the host.

docker/compose.core.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ services:
107107
image: nats:alpine
108108
restart: unless-stopped
109109
ports:
110-
- "127.0.0.1:4222:4222"
110+
# Loopback-only by default. Set NATS_BIND_HOST=0.0.0.0 (or a specific interface) to let other
111+
# hosts reach the bus — only on a trusted or firewalled network, as NATS runs unauthenticated.
112+
- "${NATS_BIND_HOST:-127.0.0.1}:4222:4222"
111113
command: ["--config", "/etc/nats/nats-server.conf"]
112114
volumes:
113115
- nats-data:/data

0 commit comments

Comments
 (0)