-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
311 lines (291 loc) · 7.28 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
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
version: '3.8'
name: chat
services:
ws-sender:
labels:
app: ws-sender
restart: on-failure
build:
context: $PWD/services/ws-sender/
dockerfile: $PWD/services/ws-sender/Dockerfile
env_file:
- $PWD/services/ws-sender/.env
expose:
- "8081"
deploy:
mode: replicated
replicas: 2
endpoint_mode: dnsrr
depends_on:
redis:
condition: service_healthy
oathkeeper:
condition: service_healthy
ws-receiver:
labels:
app: ws-receiver
restart: on-failure
build:
context: $PWD/services/ws-receiver/
dockerfile: $PWD/services/ws-receiver/Dockerfile
env_file:
- $PWD/services/ws-receiver/.env
expose:
- "8082"
deploy:
mode: replicated
replicas: 2
endpoint_mode: dnsrr
depends_on:
redis:
condition: service_healthy
oathkeeper:
condition: service_healthy
history-writer:
labels:
app: history-writer
restart: on-failure
build:
context: $PWD/services/history-writer/
dockerfile: $PWD/services/history-writer/Dockerfile
env_file:
- $PWD/services/history-writer/.env
deploy:
mode: replicated
replicas: 2
depends_on:
redis:
condition: service_healthy
scylladb:
condition: service_healthy
history-loader:
labels:
app: history-loader
restart: on-failure
build:
context: $PWD/services/history-loader/
dockerfile: $PWD/services/history-loader/Dockerfile
env_file:
- $PWD/services/history-loader/.env
deploy:
mode: replicated
replicas: 2
depends_on:
scylladb:
condition: service_healthy
oathkeeper:
condition: service_healthy
kratos:
labels:
app: kratos
image: oryd/kratos:v1.0
restart: on-failure
container_name: kratos
healthcheck:
test: >
wget --no-verbose --tries=1 --spider http://localhost:4433/health/alive || exit 1
interval: 30s
timeout: 5s
start_period: 10s
retries: 5
volumes:
- type: bind
source: ./ory/kratos
target: /etc/config/
command: -c /etc/config/kratos.compose.yaml serve --dev --watch-courier
environment:
- DSN=postgres://local:local@postgres:5432/chat?sslmode=disable&max_conns=20&max_idle_conns=4
- SERVE_PUBLIC_BASE_URL=http://127.0.0.1:4455/.ory/kratos/public/
depends_on:
kratos-migrate:
condition: service_completed_successfully
mailslurper:
condition: service_started
ports:
- '4433:4433' # public
- '4434:4434' # admin
kratos-migrate:
image: oryd/kratos:v1.0
restart: on-failure
container_name: kratos-migrate
volumes:
- type: bind
source: ./ory/kratos
target: /etc/config/kratos
command:
migrate sql -e --yes
environment:
- DSN=postgres://local:local@postgres:5432/chat?sslmode=disable&max_conns=20&max_idle_conns=4
depends_on:
- postgres
oathkeeper:
labels:
app: oathkeeper
image: oryd/oathkeeper:v0.40
depends_on:
- kratos
ports:
- "4455:4455"
- "4456:4456"
command:
serve proxy -c "/etc/config/oathkeeper.compose.yaml"
environment:
- LOG_LEVEL=debug
restart: on-failure
healthcheck:
test: >
wget --no-verbose --tries=1 --spider --header="Origin: http://localhost" http://localhost:4456/health/alive || exit 1
interval: 20s
timeout: 5s
start_period: 5s
retries: 5
volumes:
- ./ory/oathkeeper:/etc/config
mailslurper:
labels:
app: mailslurper
image: oryd/mailslurper:latest-smtps
restart: on-failure
container_name: mailslurper
ports:
- '4436:4436'
- '4437:4437'
postgres:
labels:
app: postgres
image: postgres:16.0-alpine3.18
container_name: postgres
restart: on-failure
ports:
- "5432:5432"
environment:
POSTGRES_DB: chat
POSTGRES_USER: local
POSTGRES_PASSWORD: local
healthcheck:
test: pg_isready -U local -d chat
interval: 1s
timeout: 3s
retries: 5
start_period: 2s
volumes:
- pg-data:/var/lib/postgresql/data
redis:
labels:
app: redis
image: redis:7.2.2-alpine3.18
restart: on-failure
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 1s
timeout: 3s
retries: 5
ports:
- "6379:6379"
scylladb:
labels:
app: scylladb
restart: on-failure
image: scylladb/scylla:5.2
healthcheck:
test: [ "CMD-SHELL", "[ $$(nodetool statusgossip) = running ]" ]
interval: 3s
timeout: 3s
retries: 10
start_period: 13s
volumes:
- scylladb-data:/var/lib/scylla
ports:
- "9042:9042"
otel-collector:
labels:
app: otel-collector
restart: on-failure
image: otel/opentelemetry-collector:0.88.0
command: [ "--config=/etc/otel.yaml" ]
expose:
- "4318" # HTTP otel receiver
- "8889" # Prometheus exporter metrics
volumes:
- ./otel.yaml:/etc/otel.yaml
ports:
- "1888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP http receiver
- "55679:55679" # zpages extension
grafana:
labels:
app: grafana
restart: on-failure
image: grafana/grafana:10.2.0
volumes:
- ./grafana-datasources.yaml:/etc/grafana/provisioning/datasources/provisioning-datasources.yaml:ro
- grafana_data:/var/lib/grafana
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_USERS_DEFAULT_THEME=dark
- GF_LOG_MODE=console
- GF_LOG_LEVEL=info
ports:
- "9000:3000"
mimir:
labels:
app: mimir
restart: on-failure
image: grafana/mimir:latest
command: [ "-config.file=/etc/mimir.yaml" ]
hostname: mimir-1
ports:
- "9001:8080"
volumes:
- ./mimir.yaml:/etc/mimir.yaml
- mimir-data:/data
loki:
labels:
app: loki
image: grafana/loki:2.9.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
volumes:
- loki-data:/loki
promtail:
labels:
app: promtail
image: grafana/promtail:2.9.0
command: -config.file=/etc/promtail/config.yml
environment:
CLIENT_URL: http://loki:3100/loki/api/v1/push
volumes:
# custom config will read logs from the containers of
# this project
- ./promtail.yaml:/etc/promtail/config.yml
# to read container labels and logs
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers:/var/lib/docker/containers
tempo:
labels:
app: tempo
image: grafana/tempo:latest
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./tempo.yaml:/etc/tempo.yaml
- ./tempo-data:/tmp/tempo
ports:
- "14268" # jaeger ingest
- "3200" # tempo
- "4317" # otlp grpc
- "4318" # otlp http
- "9411" # zipkin
volumes:
pg-data:
scylladb-data:
minio-data:
mimir-data:
loki-data:
grafana_data:
tempo-data: