generated from dopos/dcape-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
144 lines (137 loc) · 5.26 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
# This file will be joined with docker-compose.app.yml from dcape
# See https://github.com/dopos/dcape
services:
# This service will extend code from dcape
app:
labels:
- traefik.http.services.${APP_TAG}.loadbalancer.server.port=14318
- traefik.http.routers.${APP_TAG}.service=${APP_TAG}
- traefik.http.routers.${APP_TAG}-grpc.service=${APP_TAG}-grpc
- traefik.http.routers.${APP_TAG}-grpc.rule=Host(`${GRPC_SITE}`)
- traefik.http.routers.${APP_TAG}-grpc.tls=${USE_TLS}
- traefik.http.routers.${APP_TAG}-grpc.tls.certresolver=default
- traefik.http.services.${APP_TAG}-grpc.loadbalancer.server.port=14317
- traefik.http.services.${APP_TAG}-grpc.loadbalancer.server.scheme=h2c
environment:
- APP_SITE
- GRPC_SITE
- USER_EMAIL
- USER_PASS
- PGDATABASE
- PGUSER
- PGPASSWORD
- UPTRACE_PROJECT_KEY1
- UPTRACE_PROJECT_KEY2
- UPTRACE_SECRET_KEY
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318
- OTEL_EXPORTER_OTLP_COMPRESSION=gzip
- OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=BASE2_EXPONENTIAL_BUCKET_HISTOGRAM
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=DELTA
volumes:
- ./etc/uptrace.yml:/etc/uptrace/uptrace.yml
depends_on:
- ch_db
- otelcol
- mailpit
ch_db:
image: clickhouse/clickhouse-server:${CLIHO_VER}
restart: always
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./var/ch_data:/var/lib/clickhouse
- ./etc/clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
# - ./etc/clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
- ./etc/clickhouse/docker_related_config.xml:/etc/clickhouse-server/config.d/docker_related_config.xml:ro
- ./var/ch_log:/var/log/clickhouse-server
# - ${DCAPE_ROOT}/var/ch-uptrace:/var/lib/clickhouse
environment:
CLICKHOUSE_DB: uptrace
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'localhost:8123/ping']
interval: 1s
timeout: 1s
retries: 30
ulimits:
nofile:
soft: 262144
hard: 262144
cap_add:
- CAP_SYS_NICE
otelcol:
image: otel/opentelemetry-collector-contrib:${OTELCOL_VER}
restart: always
labels:
- traefik.enable=true
- dcape.traefik.tag=${DCAPE_TAG}
- traefik.http.routers.${APP_TAG}-otc.rule=Host(`${OTC_SITE}`)
- traefik.http.routers.${APP_TAG}-otc.tls=${USE_TLS}
- traefik.http.routers.${APP_TAG}-otc.tls.certresolver=default
- traefik.http.routers.${APP_TAG}-otc.service=${APP_TAG}-otc
- traefik.http.services.${APP_TAG}-otc.loadbalancer.server.port=4318
- traefik.http.routers.${APP_TAG}-grpcotc.rule=Host(`${OTC_GRPC_SITE}`)
- traefik.http.routers.${APP_TAG}-grpcotc.tls=${USE_TLS}
- traefik.http.routers.${APP_TAG}-grpcotc.tls.certresolver=default
- traefik.http.routers.${APP_TAG}-grpcotc.service=${APP_TAG}-grpcotc
- traefik.http.services.${APP_TAG}-grpcotc.loadbalancer.server.port=4317
- traefik.http.services.${APP_TAG}-grpcotc.loadbalancer.server.scheme=h2c
environment:
- APP_SITE
- GRPC_SITE
- PGDATABASE
- PGUSER
- PGPASSWORD
- UPTRACE_PROJECT_KEY2
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /etc/ssl/certs:/etc/ssl/certs:ro
# - /:/hostfs:ro
- ./etc/otel-collector.yaml:/etc/otelcol-contrib/config.yaml
grafana:
image: ${GF_IMAGE}:${GF_IMAGE_VER}
restart: always
labels:
- traefik.enable=true
- dcape.traefik.tag=${DCAPE_TAG}
- traefik.http.routers.${APP_TAG}-graf.rule=Host(`${GRAF_SITE}`)
- traefik.http.routers.${APP_TAG}-graf.tls=${USE_TLS}
- traefik.http.routers.${APP_TAG}-graf.tls.certresolver=default
- traefik.http.services.${APP_TAG}-graf.loadbalancer.server.port=3000
environment:
- GF_SECURITY_ADMIN_USER=${USER_EMAIL}
- GF_SECURITY_ADMIN_PASSWORD=${USER_PASS}
- GF_INSTALL_PLUGINS
- UPTRACE_PROJECT_KEY1
- UPTRACE_PROJECT_KEY2
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /etc/ssl/certs:/etc/ssl/certs:ro
- ./var/grafana:/var/lib/grafana
- ./etc/grafana.yml:/etc/grafana/provisioning/datasources/datasource.yml
mailpit:
image: axllent/mailpit:v1.16.0
hostname: mailpit
restart: always
labels:
- traefik.enable=true
- dcape.traefik.tag=${DCAPE_TAG}
- traefik.http.routers.${APP_TAG}-mail.rule=Host(`${MAIL_SITE}`)
- traefik.http.routers.${APP_TAG}-mail.tls=${USE_TLS}
- traefik.http.routers.${APP_TAG}-mail.tls.certresolver=default
- traefik.http.services.${APP_TAG}-mail.loadbalancer.server.port=8025
environment:
MP_UI_AUTH: "${USER_EMAIL}:${USER_PASS}"
MP_SMTP_BIND_ADDR: 0.0.0.0:25
MP_MAX_MESSAGES: 5000
MP_DATA_FILE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_REQUIRE_TLS: 1
MP_SMTP_TLS_CERT: /config/ssl/mail.crt.pem
MP_SMTP_TLS_KEY: /config/ssl/mail.pk.pem
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ./var/ssl:/config/ssl
- ./var/mailpit_data:/data