homelab/proxmox/services/swarm-based/nats.yml
2026-04-01 16:07:44 -04:00

55 lines
1 KiB
YAML

version: '3.8'
# Deploy with:
# docker stack deploy -c nats.yml nats
#
# Runs on: pve-tools
# JetStream enabled for persistent messaging.
# Services connect to nats_nats:4222 via overlay, or host:4222 externally.
services:
nats:
image: nats:latest
command:
- -c=/etc/nats/nats.conf
ports:
- target: 4222
published: 4222
protocol: tcp
mode: host
- target: 8080
published: 8080
protocol: tcp
mode: host
- target: 8222
published: 8223
protocol: tcp
mode: host
volumes:
- nats_data:/data
configs:
- source: nats_conf
target: /etc/nats/nats.conf
networks:
- overlay-net
deploy:
replicas: 1
placement:
constraints:
- node.hostname == pve-tools
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
configs:
nats_conf:
file: ./nats.conf
volumes:
nats_data:
networks:
overlay-net:
external: true
name: ${OVERLAY_NETWORK:-homelab-net}