-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathdocker-compose.yml
198 lines (193 loc) · 5.46 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
version: "3"
x-default-logging: &logging
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
networks:
default:
name: api-o11y
driver: bridge
services:
mysql-auth:
image: mariadb:10.5.8
command: --default-authentication-plugin=mysql_native_password --init-file /data/application/init.sql
volumes:
- ./auth/ops/db/init.sql:/data/application/init.sql
environment:
MYSQL_ROOT_PASSWORD: auth_pwd
MYSQL_DATABASE: auth_db
MYSQL_USER: auth_user
MYSQL_PASSWORD: auth_pwd
ports:
- "3306:3306"
container_name: auth_mysql
mysql-feedbacks:
image: mariadb:10.5.8
command: --default-authentication-plugin=mysql_native_password --init-file /data/application/init.sql
volumes:
- ./feedbacks/ops/db/init.sql:/data/application/init.sql
environment:
MYSQL_ROOT_PASSWORD: feedbacks_pwd
MYSQL_DATABASE: feedbacks_db
MYSQL_USER: feedbacks_user
MYSQL_PASSWORD: feedbacks_pwd
ports:
- "3307:3306"
container_name: feedbacks_mysql
mysql-votes:
image: mariadb:10.5.8
command: --default-authentication-plugin=mysql_native_password --init-file /data/application/init.sql
volumes:
- ./votes/ops/db/init.sql:/data/application/init.sql
environment:
MYSQL_ROOT_PASSWORD: votes_pwd
MYSQL_DATABASE: votes_db
MYSQL_USER: votes_user
MYSQL_PASSWORD: votes_pwd
ports:
- "3308:3306"
container_name: votes_mysql
auth:
image: auth
build:
context: ./
dockerfile: ./auth/Dockerfile
environment:
DB_USER: "auth_user"
DB_PASSWORD: "auth_pwd"
DB_HOST: "auth_mysql"
DB_DATABASE: "auth_db"
DB_PORT: "3306"
PORT: "8081"
OTEL_EXPORTER_OTLP_ENDPOINT: "${OTEL_EXPORTER_OTLP_ENDPOINT}"
JAEGER_TRACEPROVIDER: "${JAEGER_TRACEPROVIDER}"
ports:
- "8081:8081"
container_name: auth
depends_on:
- mysql-auth
- otelcol
feedbacks:
image: feedbacks
build:
context: ./
dockerfile: ./feedbacks/Dockerfile
environment:
DB_USER: "feedbacks_user"
DB_PASSWORD: "feedbacks_pwd"
DB_HOST: "feedbacks_mysql"
DB_DATABASE: "feedbacks_db"
DB_PORT: "3306"
PORT: "8082"
AUTH_URL: "http://auth:8081"
OTEL_EXPORTER_OTLP_ENDPOINT: "${OTEL_EXPORTER_OTLP_ENDPOINT}"
JAEGER_TRACEPROVIDER: "${JAEGER_TRACEPROVIDER}"
ports:
- "8082:8082"
container_name: feedbacks
depends_on:
- mysql-feedbacks
- otelcol
votes:
image: votes
build:
context: ./
dockerfile: ./votes/Dockerfile
environment:
DB_USER: "votes_user"
DB_PASSWORD: "votes_pwd"
DB_HOST: "votes_mysql"
DB_DATABASE: "votes_db"
DB_PORT: "3306"
PORT: "8083"
AUTH_URL: "http://auth:8081"
OTEL_EXPORTER_OTLP_ENDPOINT: "${OTEL_EXPORTER_OTLP_ENDPOINT}"
JAEGER_TRACEPROVIDER: "${JAEGER_TRACEPROVIDER}"
ports:
- "8083:8083"
container_name: votes
depends_on:
- mysql-votes
- otelcol
# ********************
# Telemetry Components
# ********************
# Jaeger
jaeger:
image: jaegertracing/all-in-one
container_name: jaeger
command:
- "--log-level=debug"
- "--memory.max-traces"
- "10000"
- "--query.base-path"
- "/jaeger/ui"
- "--prometheus.server-url"
- "http://${PROMETHEUS_ADDR}"
deploy:
resources:
limits:
memory: 300M
restart: unless-stopped
ports:
- "${JAEGER_SERVICE_PORT}:${JAEGER_SERVICE_PORT}" # Jaeger UI
- "14250:14250"
- "14268:14268" # Jaeger collector
- "4317" # OTLP gRPC default port
environment:
- COLLECTOR_OTLP_ENABLED=true
- METRICS_STORAGE_TYPE=prometheus
logging: *logging
# Grafana
grafana:
image: grafana/grafana:9.1.0
container_name: grafana
ports:
- "${GRAFANA_SERVICE_PORT}:${GRAFANA_SERVICE_PORT}"
depends_on:
- prometheus
logging: *logging
# OpenTelemetry Collector
otelcol:
image: otel/opentelemetry-collector-contrib:0.74.0
container_name: otel-col
deploy:
resources:
limits:
memory: 125M
restart: unless-stopped
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ]
volumes:
- ./ops/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
- ./ops/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml
ports:
- "4317" # OTLP over gRPC receiver
- "4318:4318" # OTLP over HTTP receiver
- "9464" # Prometheus exporter
- "8888" # metrics endpoint
depends_on:
- jaeger
logging: *logging
# Prometheus
prometheus:
image: quay.io/prometheus/prometheus:v2.34.0
container_name: prometheus
command:
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
- --storage.tsdb.retention.time=1h
- --config.file=/etc/prometheus/prometheus-config.yaml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
- --web.route-prefix=/
- --enable-feature=exemplar-storage
volumes:
- ./ops/prometheus/prometheus-config.yaml:/etc/prometheus/prometheus-config.yaml
deploy:
resources:
limits:
memory: 300M
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
logging: *logging