diff --git a/docker-compose-nats.yml b/docker-compose-nats.yml new file mode 100644 index 0000000..3f7d878 --- /dev/null +++ b/docker-compose-nats.yml @@ -0,0 +1,29 @@ +services: + nats: + image: nats:latest + container_name: nats + ports: + - "4222:4222" # NATS client port + - "8222:8222" # HTTP monitoring port + - "6222:6222" # Cluster port + command: + - "-js" # Enable JetStream + - "-sd" # Store directory + - "/data" + - "-m" # Enable monitoring + - "8222" + - "--user" + - "nats" + - "--pass" + - "nats123" + volumes: + - nats-data:/data + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"] + interval: 10s + timeout: 5s + retries: 3 + +volumes: + nats-data: