-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
276 lines (257 loc) · 6.41 KB
/
docker-compose.prod.yml
File metadata and controls
276 lines (257 loc) · 6.41 KB
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
version: '3.8'
# Production compose — uses pre-built images from GHCR.
# Required .env variables (written by the deploy workflow):
# IMAGE_BASE e.g. ghcr.io/your-org/open-wes
# IMAGE_TAG git SHA of the deployed commit
# HOST_IP server's LAN IP (used by the frontend to reach the gateway)
services:
frontend:
container_name: frontend
image: ${IMAGE_BASE}/frontend:${IMAGE_TAG:-latest}
ports:
- "80:80"
extra_hosts:
- "api-gateway:${HOST_IP}"
networks:
- my-network
gateway-server:
container_name: gateway
image: ${IMAGE_BASE}/gateway:${IMAGE_TAG:-latest}
ports:
- "8090:8090"
volumes:
- gateway-logs:/app/logs
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nacos:
condition: service_healthy
networks:
- my-network
station-server:
container_name: station
image: ${IMAGE_BASE}/station:${IMAGE_TAG:-latest}
ports:
- "9040:9040"
volumes:
- station-logs:/app/logs
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nacos:
condition: service_healthy
networks:
- my-network
wes-server:
container_name: wes
image: ${IMAGE_BASE}/wes:${IMAGE_TAG:-latest}
ports:
- "9010:9010"
volumes:
- wes-logs:/app/logs
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nacos:
condition: service_healthy
networks:
- my-network
mysql:
container_name: mysql
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_INNODB_BUFFER_POOL_SIZE: 2G
MYSQL_INNODB_LOG_FILE_SIZE: 512M
MYSQL_INNODB_FLUSH_LOG_AT_TRX_COMMIT: 2
MYSQL_SYNC_BINLOG: 0
MYSQL_INNODB_FLUSH_METHOD: O_DIRECT
MYSQL_MAX_CONNECTIONS: 1000
MYSQL_INNODB_BUFFER_POOL_INSTANCES: 4
ports:
- "3306:3306"
volumes:
- /data/mysql_data:/var/lib/mysql
- ./initdb.d:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 10s
retries: 10
start_period: 30s
networks:
my-network:
aliases:
- mysql.openwes.com
redis:
container_name: redis
image: redis:7.2
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 10s
retries: 10
start_period: 30s
networks:
my-network:
aliases:
- redis.openwes.com
nacos:
container_name: nacos
image: nacos/nacos-server:2.0.0
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
environment:
MODE: standalone
SPRING_DATASOURCE_PLATFORM: mysql
MYSQL_SERVICE_HOST: mysql
MYSQL_SERVICE_DB_NAME: nacos_config
MYSQL_SERVICE_USER: root
MYSQL_SERVICE_PASSWORD: root
depends_on:
- mysql
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/"]
interval: 5s
timeout: 10s
retries: 10
start_period: 30s
networks:
my-network:
aliases:
- nacos.openwes.com
# --- Monitoring Stack ---
prometheus:
container_name: prometheus
image: prom/prometheus:v2.52.0
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./monitoring/prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.retention.time=15d"
mem_limit: 512m
networks:
- my-network
grafana:
container_name: grafana
image: grafana/grafana:11.1.0
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-admin}
GF_SECURITY_ALLOW_EMBEDDING: "true"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
- grafana-data:/var/lib/grafana
mem_limit: 256m
depends_on:
- prometheus
networks:
- my-network
loki:
container_name: loki
image: grafana/loki:3.1.0
ports:
- "3100:3100"
volumes:
- ./monitoring/loki/loki-config.yml:/etc/loki/local-config.yaml
- loki-data:/loki
command: -config.file=/etc/loki/local-config.yaml
mem_limit: 768m
networks:
- my-network
promtail:
container_name: promtail
image: grafana/promtail:3.1.0
volumes:
- ./monitoring/promtail/promtail-config.yml:/etc/promtail/config.yml
- wes-logs:/var/log/wes:ro
- station-logs:/var/log/station:ro
- gateway-logs:/var/log/gateway:ro
command: -config.file=/etc/promtail/config.yml
mem_limit: 128m
depends_on:
- loki
networks:
- my-network
alertmanager:
container_name: alertmanager
image: prom/alertmanager:v0.27.0
ports:
- "9093:9093"
volumes:
- ./monitoring/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
mem_limit: 64m
networks:
- my-network
node-exporter:
container_name: node-exporter
image: prom/node-exporter:v1.8.1
ports:
- "9100:9100"
mem_limit: 64m
networks:
- my-network
mysql-exporter:
container_name: mysql-exporter
image: prom/mysqld-exporter:v0.15.1
ports:
- "9104:9104"
environment:
DATA_SOURCE_NAME: "root:root@(mysql:3306)/"
depends_on:
mysql:
condition: service_healthy
mem_limit: 64m
networks:
- my-network
redis-exporter:
container_name: redis-exporter
image: oliver006/redis_exporter:v1.61.0
ports:
- "9121:9121"
environment:
REDIS_ADDR: "redis:6379"
depends_on:
redis:
condition: service_healthy
mem_limit: 64m
networks:
- my-network
kafka-exporter:
container_name: kafka-exporter
image: danielqsj/kafka-exporter:v1.7.0
ports:
- "9308:9308"
command: ["--kafka.server=kafka:9092"]
mem_limit: 64m
networks:
- my-network
volumes:
wes-logs:
station-logs:
gateway-logs:
prometheus-data:
grafana-data:
loki-data:
networks:
my-network:
driver: bridge