-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
66 lines (62 loc) · 1.64 KB
/
docker-compose.yaml
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
version: "3.9"
services:
# benthos setup
benthos:
image: jeffail/benthos
volumes:
- "./configs/benthos.config.yaml:/benthos.yaml"
ports:
- "4195:4195"
# two nats clusters
nats-1:
container_name: nats-cluster-n1
image: nats:latest
entrypoint: /nats-server
ports:
- "4222:4222"
command: --name n1 --cluster_name NATS1 --js --sd /data -p 4222
nats-2:
container_name: nats-cluster-n2
image: nats:latest
entrypoint: /nats-server
ports:
- "4223:4222"
command: --name n2 --cluster_name NATS2 --js --sd /data -p 4222
# bootstrap container
bootstrap:
build:
context: .
dockerfile: build/Dockerfile
volumes:
- "./configs/example.config.yaml:bin/config.yaml"
command: --service boot --config config.yaml
# consumers on nats-1 and nats-2
consumer-n1:
depends_on:
- bootstrap
build:
context: .
dockerfile: build/Dockerfile
volumes:
- "./configs/example.config.yaml:bin/config.yaml"
command: --service consumer --config config.yaml --nats nats://nats-1:4222
consumer-n2:
depends_on:
- bootstrap
build:
context: .
dockerfile: build/Dockerfile
volumes:
- "./configs/example.config.yaml:bin/config.yaml"
command: --service consumer --config config.yaml --nats nats://nats-2:4222
# a publisher on nats1
provider-n1:
depends_on:
- consumer-n1
- consumer-n2
build:
context: .
dockerfile: build/Dockerfile
volumes:
- "./configs/example.config.yaml:bin/config.yaml"
command: --service provider --config config.yaml --nats nats://nats-1:4222