-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathdocker-compose.yml
286 lines (269 loc) · 6.69 KB
/
docker-compose.yml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
version: '3.6'
networks:
app: {}
services:
################################# Persistence ###################################
pulsar:
restart: always
image: apachepulsar/pulsar:2.10.1
ports:
- 6650:6650
- 8080:8080
command: >
/bin/bash -c "bin/pulsar standalone"
networks:
- app
volumes:
- ./pulsarconf/standalone.conf:/pulsar/conf/standalone.conf
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/admin/v2/brokers/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
redis:
restart: always
image: redis:6.0.8
ports:
- 6379:6379
environment:
- DEBUG=false
networks:
- app
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
################################# Monitoring ###################################
pulsar-manager:
restart: always
image: apachepulsar/pulsar-manager:v0.2.0
ports:
- 9527:9527
- 7750:7750
networks:
- app
depends_on:
pulsar:
condition: service_healthy
volumes:
- ./monitoring/pulsar-manager/application.properties:/pulsar-manager/custom.properties
environment:
- SPRING_CONFIGURATION_FILE=/pulsar-manager/custom.properties
prometheus:
restart: always
image: prom/prometheus:v2.30.3
ports:
- 9090:9090
networks:
- app
volumes:
- ./monitoring/prometheus/config.yml:/etc/prometheus/prometheus.yml
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'
links:
- alerts:alerts
- processor:processor
- snapshots:snapshots
- tracing:tracing
- ws-server:ws-server
healthcheck:
test: ["CMD", "wget", "--tries=1", "--spider", "http://localhost:9090"]
interval: 2s
timeout: 5s
retries: 15
grafana:
restart: always
image: grafana/grafana:8.2.2
ports:
- 3000:3000
environment:
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
networks:
- app
volumes:
- ./monitoring/grafana/:/etc/grafana/provisioning
depends_on:
prometheus:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--tries=1", "--spider", "http://localhost:3000/api/health"]
interval: 2s
timeout: 5s
retries: 15
################################# Services ###################################
ws-server:
restart: always
image: trading-ws:latest
ports:
- 9000:9000
networks:
- app
environment:
- HTTP_PORT=9000
- PULSAR_URI=pulsar://pulsar:6650
depends_on:
pulsar:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
alerts:
restart: always
image: trading-alerts:latest
ports:
- 9004:9004
networks:
- app
environment:
- HTTP_PORT=9004
- REDIS_URI=redis://redis
- PULSAR_URI=pulsar://pulsar:6650
depends_on:
pulsar:
condition: service_healthy
redis:
condition: service_healthy
ws-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9004/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
processor:
restart: always
image: trading-processor:latest
ports:
- 9003:9003
networks:
- app
environment:
- HTTP_PORT=9003
- REDIS_URI=redis://redis
- PULSAR_URI=pulsar://pulsar:6650
depends_on:
pulsar:
condition: service_healthy
redis:
condition: service_healthy
ws-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9003/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
snapshots:
restart: always
image: trading-snapshots:latest
ports:
- 9002:9002
networks:
- app
environment:
- HTTP_PORT=9002
- REDIS_URI=redis://redis
- PULSAR_URI=pulsar://pulsar:6650
depends_on:
pulsar:
condition: service_healthy
redis:
condition: service_healthy
ws-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9002/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
tracing:
restart: always
image: trading-tracing:latest
ports:
- 9005:9005
networks:
- app
environment:
- HTTP_PORT=9005
- PULSAR_URI=pulsar://pulsar:6650
- HONEYCOMB_API_KEY=${HONEYCOMB_API_KEY}
depends_on:
pulsar:
condition: service_healthy
alerts:
condition: service_healthy
processor:
condition: service_healthy
snapshots:
condition: service_healthy
ws-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9005/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
forecasts:
restart: always
image: trading-forecasts:latest
ports:
- 9006:9006
networks:
- app
environment:
- HTTP_PORT=9006
- PULSAR_URI=pulsar://pulsar:6650
depends_on:
pulsar:
condition: service_healthy
ws-server:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9006/health"]
interval: 2s
timeout: 5s
retries: 15
start_period: 2m
# Does not work yet because of issues with sbt-native-packager (it depends on a test dependency).
# Comment out the feed service if you don't want random data generation running in Docker
#feed:
#restart: always
#image: trading-feed:latest
#ports:
#- "9001:9001"
#networks:
#- app
#environment:
#- HTTP_PORT=9001
#- PULSAR_URI=pulsar://pulsar:6650
#depends_on:
#pulsar:
#condition: service_healthy
#alerts:
#condition: service_healthy
#processor:
#condition: service_healthy
#snapshots:
#condition: service_healthy
#ws-server:
#condition: service_healthy
#healthcheck:
#test: ["CMD", "curl", "-f", "http://localhost:9001/health"]
#interval: 2s
#timeout: 5s
#retries: 15
#start_period: 2m