services: nats: image: nats:2.10-alpine ports: - "4222:4222" - "8222:8222" command: ["-js", "-m", "8222"] healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8222/healthz"] interval: 5s timeout: 3s retries: 5 app: build: . ports: - "3000:3000" environment: - NODE_ENV=production - PORT=3000 - HOST=0.0.0.0 - NATS_SERVERS=nats://nats:4222 depends_on: nats: condition: service_healthy restart: unless-stopped