-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
263 lines (245 loc) · 6.95 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
version: "3.8"
services:
##########################################################
# Applications #
##########################################################
news-db:
container_name: news-db
hostname: news-db
image: mariadb:11.1.2
restart: always
networks:
- envite
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: newsdb
MYSQL_USER: user
MYSQL_PASSWORD: password
volumes:
- ./news-db/init.sql:/docker-entrypoint-initdb.d/init.sql:roz
- ./datasource/News_Category_Dataset_v3.csv:/etc/News_Category_Dataset_v3.csv:roz
news-default:
container_name: news-default
hostname: news-default
image: news:1.0.0
depends_on:
- news-db
restart: always
networks:
- envite
ports:
- "8081:8081"
- "8181:8181"
environment:
SERVER_PORT: 8081
MANAGEMENT_SERVER_PORT: 8181
SPRING_DATASOURCE_URL: jdbc:mariadb://news-db:3306/newsdb
SPRING_DATASOURCE_USERNAME: user
SPRING_DATASOURCE_PASSWORD: password
labels:
traefik.enable: "true"
traefik.http.services.news-default.loadbalancer.server.port: 8081
traefik.http.routers.news-default.middlewares: "auth-user@file"
user-interest-db:
container_name: user-interest-db
hostname: user-interest-db
image: redis:7.2.3-alpine
restart: always
networks:
- envite
ports:
- "6379:6379"
user-interest-db-init:
container_name: user-interest-db-init
hostname: user-interest-db-init
image: user-interest-db-init:1.0.0
depends_on:
- user-interest-db
restart: on-failure
networks:
- envite
environment:
APP_USERSDATASETCSVFILE: /workspace/datasource/users.csv
APP_NEWSDATASETCSVFILE: /workspace/datasource/News_Category_Dataset_v3.csv
APP_USERSCOUNT: 10000
APP_MININTERESTS: 0
APP_MAXINTERESTS: 10
APP_NEWSFROMDATE: "2012-01-01"
APP_NEWSUNTILDATE: "2018-04-30" #"2018-04-30" #"2022-09-23"
APP_RANDOMSEED: 11235813
SPRING_DATA_REDIS_HOST: user-interest-db
SPRING_DATA_REDIS_PORT: 6379
volumes:
- ./datasource/users.csv:/workspace/datasource/users.csv:roz
- ./datasource/News_Category_Dataset_v3.csv:/workspace/datasource/News_Category_Dataset_v3.csv:roz
interest-feed-default:
container_name: interest-feed-default
hostname: interest-feed-default
image: interest-feed:1.0.0
depends_on:
- user-interest-db
restart: always
networks:
- envite
ports:
- "8082:8082"
- "8182:8182"
environment:
SERVER_PORT: 8082
MANAGEMENT_SERVER_PORT: 8182
SPRING_DATA_REDIS_HOST: user-interest-db
SPRING_DATA_REDIS_PORT: 6379
SERVICE_NEWS_URL: http://news-default:8081
FEED_LIMIT: 20
FEED_PERIOD: P1W
labels:
traefik.enable: "true"
traefik.http.services.interest-feed-default.loadbalancer.server.port: 8082
traefik.http.routers.interest-feed-default.middlewares: "auth-user@file"
# benchmark-default:
# container_name: benchmark-default
# hostname: benchmark-default
# image: benchmark:1.0.0
# restart: always
# networks:
# - envite
# ports:
# - "8183:8183"
# environment:
# SERVER_PORT: 8183
# MANAGEMENT_SERVER_PORT: 8183
# SERVICE_INTERESTFEED_URL: http://interest-feed-default:8082
# BENCHMARK_INITIALDELAY: '30s'
# BENCHMARK_INTERMEDIATEDELAY: '30s'
# BENCHMARK_SHUTDOWNDELAY: '30s'
# BENCHMARK_NUMBEROFUSERS: 100
# BENCHMARK_DATE: '2013-08-05'
# BENCHMARK_REQUESTDELAY: '1s'
# BENCHMARK_TESTDURATION: '0s'
# BENCHMARK_REQUESTSPERUSER: 250
##########################################################
# Monitoring #
##########################################################
prometheus:
container_name: prometheus
hostname: prometheus
image: prom/prometheus:v2.48.0
restart: always
networks:
- envite
ports:
- "9090:9090"
extra_hosts:
- host.docker.internal:host-gateway
volumes:
- ./monitoring/prometheus/config.yaml:/etc/prometheus/prometheus.yaml:roz
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yaml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=365d"
labels:
traefik.enable: "true"
traefik.http.routers.prometheus.middlewares: "auth-user@file"
grafana:
container_name: grafana
hostname: grafana
image: grafana/grafana:10.2.0
restart: always
networks:
- envite
ports:
- "3000:3000"
volumes:
- ./monitoring/grafana/provisioning/:/etc/grafana/provisioning:roz
environment:
# https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/grafana/
GF_AUTH_DISABLE_LOGIN_FORM: "true"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
labels:
traefik.enable: "true"
traefik.http.routers.grafana.middlewares: "auth-user@file"
node_exporter:
container_name: node_exporter
hostname: node_exporter
image: quay.io/prometheus/node-exporter:v1.6.1
restart: always
network_mode: host
pid: host
user: root
privileged: true
volumes:
- /:/rootfs:ro,rslave
command:
- "--path.rootfs=/rootfs"
cadvisor:
container_name: cadvisor
hostname: cadvisor
image: gcr.io/cadvisor/cadvisor:v0.47.2
restart: always
networks:
- envite
ports:
- "9338:8080"
privileged: true
volumes:
- /:/rootfs:ro,rslave
- /var/run:/var/run:ro
- /sys:/sys:ro
- /dev/disk/:/dev/disk:ro
- /var/lib/docker/:/var/lib/docker:ro
devices:
- /dev/kmsg
command:
- "--store_container_labels=false"
- "--docker_only=true"
scaphandre:
container_name: scaphandre
hostname: scaphandre
image: hubblo/scaphandre:0.5.0
restart: always
networks:
- envite
ports:
- "9500:8080"
privileged: true
volumes:
- /proc:/proc
- /sys:/sys
- /var/run/docker.sock:/var/run/docker.sock
command:
- "prometheus"
- "--containers"
redis-prometheus-exporter:
container_name: redis-prometheus-exporter
hostname: redis-prometheus-exporter
image: oliver006/redis_exporter:v1.55.0-alpine
restart: always
networks:
- envite
ports:
- "9121:9121"
command:
- "--redis.addr="
mariadb-prometheus-exporter:
container_name: mariadb-prometheus-exporter
hostname: mariadb-prometheus-exporter
image: prom/mysqld-exporter:v0.15.0
restart: always
networks:
- envite
ports:
- "9104:9104"
environment:
MYSQLD_EXPORTER_PASSWORD: password
command:
- "--mysqld.username=user"
networks:
envite:
driver: bridge
volumes:
prometheus-data:
name: prometheus-data