-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
80 lines (71 loc) · 1.64 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
80 lines (71 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
x-healthcheck: &healthcheck
interval: 30s
timeout: 5s
retries: 15
start_period: 3s
start_interval: 1s
x-nats-box: &nats-box
image: natsio/nats-box:${NATS_BOX_VER?:}
restart: no
entrypoint: /bin/sh
environment:
- NATS_OPERATOR
- NATS_ACCOUNT
networks:
nats:
driver: bridge
volumes:
nsc_data:
nsc_config:
nats_data:
services:
nats-init:
<<: *nats-box
command: /entrypoint.sh
volumes:
- nsc_data:/nsc
- nsc_config:/config
- ${PWD}/fs/nats-init/entrypoint.sh:/entrypoint.sh:ro
nats-server:
image: nats:${NATS_VER?:}
restart: unless-stopped
command: -c /etc/nats/nats.conf
ports:
- 4222:4222 # NATS
- 6222:6222 # Cluster
- 8222:8222 # Monitoring
- 9222:9222 # WebSocket
volumes:
- nats_data:/data
- nsc_config:/etc/nats/nsc:ro
- ${PWD}/fs/nats-server/etc/nats/nats.conf:/etc/nats/nats.conf:ro
networks:
nats:
aliases:
- nats.lokal
depends_on:
nats-init:
condition: service_completed_successfully
healthcheck:
<<: *healthcheck
test: [CMD-SHELL, wget -q --spider http://localhost:8222/healthz]
nats-push:
<<: *nats-box
command: [-c, "nsc push -A"]
volumes:
- nsc_data:/nsc
networks:
- nats
depends_on:
nats-server:
condition: service_healthy
nats-export:
<<: *nats-box
command: /entrypoint.sh
volumes:
- nsc_data:/nsc
- ${PWD}/fs/nats-export/secrets:/secrets:rw
- ${PWD}/fs/nats-export/entrypoint.sh:/entrypoint.sh:ro
depends_on:
nats-push:
condition: service_completed_successfully