-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
173 lines (160 loc) · 4.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
173 lines (160 loc) · 4.06 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
version: "3"
volumes:
prometheus_data: {}
grafana_data: {}
kafka_data:
driver: local
services:
gateway:
build:
context: ./gateway
dockerfile: Dockerfile
ports:
- "6000:6000"
environment:
- LISTEN_ADDR=gateway:6000
node1:
build:
context: ./node
dockerfile: Dockerfile
ports:
- "4000:4000"
environment:
- LISTEN_ADDR=node1:4000
- API_LISTEN_ADDR=node1:8000
- GATEWAY_ADDR=http://gateway:6000
- CONSUL_SERVICE_ADDR=node1:10000
- CONSUL_HTTP_ADDR=consul-server:8500
- IS_MINER=true
depends_on:
- gateway
node2:
build:
context: ./node
dockerfile: Dockerfile
ports:
- "4001:4001"
environment:
- LISTEN_ADDR=node2:4001
- API_LISTEN_ADDR=node2:8001
- GATEWAY_ADDR=http://gateway:6000
- CONSUL_SERVICE_ADDR=node2:10001
- CONSUL_HTTP_ADDR=consul-server:8500
- IS_MINER=false
- BOOTSTRAP_NODES=node1:4000
depends_on:
- gateway
node3:
build:
context: ./node
dockerfile: Dockerfile
ports:
- "4002:4002"
environment:
- LISTEN_ADDR=node3:4002
- API_LISTEN_ADDR=node3:8002
- GATEWAY_ADDR=http://gateway:6000
- CONSUL_SERVICE_ADDR=node3:10002
- CONSUL_HTTP_ADDR=consul-server:8500
- IS_MINER=false
- BOOTSTRAP_NODES=node2:4001
depends_on:
- gateway
node4:
build:
context: ./node
dockerfile: Dockerfile
ports:
- "4003:4003"
environment:
- LISTEN_ADDR=node4:4003
- API_LISTEN_ADDR=node4:8003
- GATEWAY_ADDR=http://gateway:6000
- CONSUL_SERVICE_ADDR=node4:10003
- CONSUL_HTTP_ADDR=consul-server:8500
- IS_MINER=false
- BOOTSTRAP_NODES=node3:4002
depends_on:
- gateway
prometheus:
image: prom/prometheus:latest
volumes:
- ./monitoring/prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- 9090:9090
logging:
driver: none
alertmanager:
image: prom/alertmanager
ports:
- 9093:9093
volumes:
- ./monitoring/alertmanager/:/etc/alertmanager/
restart: always
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
logging:
driver: none
grafana:
image: grafana/grafana
user: "472"
depends_on:
- prometheus
ports:
- 3000:3000
volumes:
- grafana_data:/var/lib/grafana
env_file:
- ./monitoring/grafana/config.monitoring
logging:
driver: none
restart: always
consul-server:
image: hashicorp/consul:latest
container_name: consul-server
restart: always
volumes:
- ./monitoring/consul/server.json:/consul/config/server.json:ro
ports:
- "8500:8500"
- "8600:8600/tcp"
- "8600:8600/udp"
command: "agent"
consul-client:
image: hashicorp/consul:latest
container_name: consul-client
restart: always
volumes:
- ./monitoring/consul/client.json:/consul/config/client.json:ro
command: "agent"
kafka:
image: docker.io/bitnami/kafka:3.5
ports:
- "9092:9092"
volumes:
- "kafka_data:/bitnami"
environment:
# KRaft settings
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
# Listeners
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
mongo:
image: mongo
ports:
- "27017:27017"
volumes:
- ./mongo:/data/db
restart: always