-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
410 lines (409 loc) · 11 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
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
services:
nginx:
image: nginx:1.27-alpine-otel
hostname: nginx
container_name: nginx-postgres
volumes:
- $PWD/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- $PWD/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- $PWD/nginx/certs/:/etc/nginx/conf.d/certs/
networks:
- metanet1-postgres
ports:
- 8443:443
deploy:
resources:
limits:
cpus: '1'
memory: 64M
reservations:
cpus: '0.5'
memory: 32M
depends_on:
metabase-postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -O /dev/null http://localhost || exit 1"]
timeout: 10s
nginx-exporter:
image: nginx/nginx-prometheus-exporter:1.2.0
networks:
- metanet1-postgres
container_name: nginx-exporter
hostname: nginx-exporter
command: --nginx.scrape-uri=http://nginx/status
depends_on:
nginx:
condition: service_healthy
deploy:
resources:
limits:
cpus: '1'
memory: 64M
reservations:
cpus: '0.5'
memory: 32M
pyroscope:
image: grafana/pyroscope:1.6.0
hostname: pyroscope
networks:
- metanet1-postgres
volumes:
- $PWD/pyroscope/config.yaml:/etc/pyroscope/config.yaml
depends_on:
grafana:
condition: service_healthy
deploy:
resources:
limits:
cpus: '2'
memory: 2048M
reservations:
cpus: '2'
memory: 2048M
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:4040/ready || exit 1" ]
interval: 5s
timeout: 5s
retries: 10
metabase-postgres:
build:
dockerfile: Dockerfile
context: runner/.
args:
version: v0.47.10
container_name: metabase-postgres
hostname: metabase
volumes:
- /dev/urandom:/dev/random:ro
- $PWD/logging_config:/metabase.db
- $PWD/pyroscope/pyroscope.jar:/app/pyroscope/pyroscope.jar
- $PWD/otel/opentelemetry-javaagent.jar:/app/otel/opentelemetry-javaagent.jar
- $PWD/jmx-exporter:/app/jmx
environment:
MB_DB_TYPE: postgres
MB_DB_CONNECTION_URI: "postgres://postgres-app-db:5432/metabase?user=metabase&password=mysecretpassword&sslmode=prefer"
MB_SITE_URL: https://localhost:8443/
MB_EMAIL_SMTP_HOST: maildev-sub
MB_EMAIL_SMTP_PASSWORD: password
MB_EMAIL_SMTP_PORT: 1025
MB_EMAIL_SMTP_SECURITY: none
MB_EMAIL_SMTP_USERNAME: admin
MB_SEND_EMAIL_ON_FIRST_LOGIN_FROM_NEW_DEVICE: FALSE
MB_PROMETHEUS_SERVER_PORT: 3300
JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true -Xms1530m -Xmx2500m -javaagent:/app/pyroscope/pyroscope.jar -javaagent:/app/otel/opentelemetry-javaagent.jar -javaagent:/app/jmx/jmx_prometheus_javaagent-1.0.1.jar=3301:/app/jmx/config.yml -Dlog4j.configurationFile=file:/metabase.db/log4j2.xml
PYROSCOPE_SERVER_ADDRESS: http://pyroscope:4040
PYROSCOPE_APPLICATION_NAME: metabase
PYROSCOPE_PROFILER_ALLOC: 524288
PYROSCOPE_PROFILER_LOCK: 10000
PYROSCOPE_FORMAT: jfr
OTEL_EXPORTER_OTLP_COMPRESSION: gzip
OTEL_EXPORTER_OTLP_INSECURE: true
OTEL_SERVICE_NAME: metabase
OTEL_TRACES_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://tempo:4318
OTEL_METRICS_EXPORTER: none
OTEL_EXPORTER_PROMETHEUS_PORT: 9090
OTEL_EXPORTER_PROMETHEUS_HOST: prometheus
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_INSTRUMENTATION_quartz_ENABLED: false
MB_COLORIZE_LOGS: false
MB_EMOJI_IN_LOGS: false
deploy:
resources:
limits:
cpus: '4'
memory: 3000M
reservations:
cpus: '4'
memory: 1500M
networks:
- metanet1-postgres
depends_on:
postgres-app-db:
condition: service_healthy
pyroscope:
condition: service_healthy
loki:
condition: service_healthy
healthcheck:
test: curl --fail -X GET -I http://localhost:3000/api/health || exit 1
interval: 15s
timeout: 5s
retries: 10
postgres-app-db:
image: postgres:16.2-alpine
container_name: postgres-app-db
hostname: postgres-app-db
ports:
- 5432:5432
environment:
POSTGRES_USER: metabase
POSTGRES_DB: metabase
POSTGRES_PASSWORD: mysecretpassword
volumes:
- $PWD/postgres_origin:/var/lib/postgresql/data
networks:
- metanet1-postgres
deploy:
resources:
limits:
cpus: '4'
memory: 2048M
reservations:
cpus: '4'
memory: 1024M
command: -c log_statement=all -c 'max_connections=10000'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U metabase -d metabase"]
interval: 5s
timeout: 5s
retries: 3
postgres-app-db-exporter:
image: prometheuscommunity/postgres-exporter:v0.15.0
container_name: postgres-app-db-exporter
hostname: postgres-app-db-exporter
deploy:
resources:
limits:
cpus: '1'
memory: 128M
reservations:
cpus: '1'
memory: 128M
environment:
- DATA_SOURCE_NAME=postgresql://metabase:mysecretpassword@postgres-app-db:5432/metabase?sslmode=disable
depends_on:
postgres-app-db:
condition: service_healthy
networks:
- metanet1-postgres
setup-postgres:
build: setup/.
container_name: setup-postgres
volumes:
- $PWD/setup/setup.py:/app/setup.py
networks:
- metanet1-postgres
depends_on:
metabase-postgres:
condition: service_healthy
command: python /app/setup.py
deploy:
resources:
limits:
cpus: '1'
memory: 64M
reservations:
cpus: '0.5'
memory: 32M
environment:
host: http://metabase
port: 3000
dbs: 3
postgres-another-data:
image: postgres:16.2-alpine
container_name: postgres-another-data
hostname: postgres-another-data
environment:
POSTGRES_USER: metabase
POSTGRES_DB: sample
POSTGRES_PASSWORD: metasample123
networks:
- metanet1-postgres
ports:
- 5435:5432
deploy:
resources:
limits:
cpus: '4'
memory: 8192M
reservations:
cpus: '4'
memory: 8192M
volumes:
- $PWD/data_origin/:/docker-entrypoint-initdb.d/
command: -c log_statement=all
healthcheck:
test: ["CMD-SHELL", "pg_isready -U metabase -d sample"]
interval: 5s
timeout: 5s
retries: 3
tempo:
image: grafana/tempo:2.5.0
hostname: tempo
container_name: tempo
networks:
- metanet1-postgres
volumes:
- $PWD/tempo/config.yaml:/etc/config.yaml
command: [ "-config.file=/etc/config.yaml" ]
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ]
interval: 10s
timeout: 5s
retries: 3
deploy:
resources:
limits:
cpus: '2'
memory: 512M
reservations:
cpus: '2'
memory: 256M
depends_on:
grafana:
condition: service_healthy
postgres-data1:
image: metabase/qa-databases:postgres-sample-15
container_name: postgres-data1
hostname: postgres-data1
networks:
- metanet1-postgres
ports:
- 5433:5432
cpus: 4
mem_limit: 8192mb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U metabase -d sample"]
interval: 5s
timeout: 5s
retries: 3
command: -c log_statement=all -c max_connections=10000
maildev-sub-postgres:
image: maildev/maildev:2.1.0
container_name: maildev-sub-postgres
hostname: maildev-sub
ports:
- 3003:1080
networks:
- metanet1-postgres
deploy:
resources:
limits:
cpus: '1'
memory: 64M
reservations:
cpus: '0.5'
memory: 32M
prometheus:
image: prom/prometheus:v2.52.0
container_name: prometheus
hostname: prometheus
networks:
- metanet1-postgres
deploy:
resources:
limits:
cpus: '1'
memory: 256M
reservations:
cpus: '1'
memory: 256M
volumes:
- $PWD/prometheus/prometheus.yml:/prometheus/prometheus.yml
command: --web.enable-remote-write-receiver
grafana:
image: grafana/grafana-oss:11.0.0
container_name: grafana
hostname: grafana
ports:
- 3030:3000
networks:
- metanet1-postgres
deploy:
resources:
limits:
cpus: '2'
memory: 512M
reservations:
cpus: '1'
memory: 256M
environment:
GF_AUTH_ANONYMOUS_ENABLED: true
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_DISABLE_LOGIN_FORM: true
GF_FEATURE_TOGGLES_ENABLE: traceqlEditor traceQLStreaming metricsSummary
volumes:
- $PWD/grafana/datasources/:/etc/grafana/provisioning/datasources/
- $PWD/grafana/dashboards/:/etc/grafana/provisioning/dashboards/
- $PWD/grafana/defaults.ini:/etc/grafana/grafana.ini
healthcheck:
test: curl --fail -X GET -I http://localhost:3000/api/health || exit 1
interval: 5s
timeout: 5s
retries: 3
api_bun:
build: api_bun/.
volumes:
- $PWD/api_bun/:/usr/src/app
container_name: api_bun
hostname: api_bun
restart: always
networks:
- metanet1-postgres
environment:
BUN_PORT: 3000
LOKI_HOST: http://loki:3100/loki/api/v1/push
POSTGRES_CONN_STRING: postgresql://metabase:mysecretpassword@postgres-app-db:5432/metabase
CREATE_METRICS_TABLE: true
deploy:
resources:
limits:
cpus: '2'
memory: 128M
reservations:
cpus: '1'
memory: 64M
depends_on:
loki:
condition: service_healthy
postgres-app-db:
condition: service_healthy
openssh-server:
image: lscr.io/linuxserver/openssh-server:version-8.8_p1-r1
container_name: ssh-postgres
hostname: ssh
environment:
- PUBLIC_KEY_FILE=/root/.ssh/id_ed25519.pub
- USER_NAME=metabase
volumes:
- $PWD/ssh/sshd_config:/config/ssh_host_keys/sshd_config
- $PWD/ssh/keys/:/root/.ssh/
networks:
- metanet1-postgres
ports:
- 2222:2222
deploy:
resources:
limits:
cpus: '0.1'
memory: 50M
reservations:
cpus: '0.05'
memory: 10M
loki:
image: grafana/loki:3.0.0
hostname: loki
container_name: loki
networks:
- metanet1-postgres
healthcheck:
test: wget --quiet --tries=1 --output-document=- http://localhost:3100/ready | grep -q -w ready || exit 1
start_period: 20s
interval: 10s
timeout: 1s
retries: 12
volumes:
- $PWD/loki/local-config.yaml:/etc/loki/local-config.yaml:ro
deploy:
resources:
limits:
cpus: '2'
memory: 256M
reservations:
cpus: '2'
memory: 128M
networks:
metanet1-postgres:
driver: bridge