Add NATS-over-WebSocket compose for Coolify

Configures a single NATS 2.10 service exposing a WebSocket listener on
:8080 (no_tls; Traefik terminates TLS at nats.volcanic.tes.gd) with
env-driven username/password auth and a persisted JetStream store.
This commit is contained in:
2026-08-25 09:37:57 +00:00
parent 964e506eb2
commit 49dcf78529
4 changed files with 168 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
services:
nats:
image: nats:2.10-alpine
restart: unless-stopped
command: ["-c", "/etc/nats/nats-server.conf"]
environment:
- SERVICE_FQDN_NATS_8080
- NATS_USER=${NATS_USER}
- NATS_PASSWORD=${NATS_PASSWORD}
volumes:
- ./nats-server.conf:/etc/nats/nats-server.conf:ro
- nats-data:/data
expose:
- "4222"
- "8080"
- "8222"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8222/healthz"]
interval: 30s
timeout: 5s
retries: 3
volumes:
nats-data: