Created
September 30, 2025 05:01
-
-
Save ipanardian/c2f1d114eb61fe36baca34f9aafc074c to your computer and use it in GitHub Desktop.
NATS Core Docker Compose (single)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NATS_USER= | |
| NATS_PASSWORD= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| nats: | |
| image: nats:2.10-alpine | |
| container_name: nats-dev | |
| ports: | |
| - "4222:4222" | |
| - "8222:8222" | |
| env_file: | |
| - .env | |
| volumes: | |
| - ./config/nats.conf:/etc/nats/nats-server.conf:ro | |
| - nats-dev-data:/data | |
| command: ["-c", "/etc/nats/nats-server.conf"] | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8222/healthz"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 3 | |
| start_period: 5s | |
| logging: | |
| driver: "json-file" | |
| options: | |
| max-size: "50m" | |
| max-file: "3" | |
| volumes: | |
| nats-dev-data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server_name: nats-dev | |
| port: 4222 | |
| http: 0.0.0.0:8222 | |
| authorization { | |
| users = [ | |
| { user: $NATS_USER, password: $NATS_PASSWORD, permission: { publish: ">", subscribe: ">" } } | |
| ] | |
| } | |
| logtime: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment