forked from sqshq/piggymetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpiggyMetrics-swarm-compose-aliyun.yml
330 lines (327 loc) · 9.87 KB
/
piggyMetrics-swarm-compose-aliyun.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
version: '2.1'
services:
rabbitmq:
image: >-
registry-vpc.cn-hangzhou.aliyuncs.com/hd_docker_images/rabbitmq:latest
hostname: rabbitmq
restart: always
ports:
- '15672:15672'
logging:
options:
max-file: '10'
max-size: 10m
labels:
aliyun.scale: '1'
aliyun.routing.port_15672: rabbitmq
memswap_limit: 0
shm_size: 0
memswap_reservation: 0
kernel_memory: 0
name: rabbitmq
config:
environment:
- CONFIG_SERVICE_PASSWORD=configPwd
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/config:latest
hostname: config
restart: always
logging:
options:
max-file: '10'
max-size: 10m
labels:
aliyun.probe.cmd: >-
curl -u user:configPwd
http://127.0.0.1:8888/account-service/spring.data.mongodb.host
aliyun.probe.initial_delay_seconds: '30'
aliyun.probe.timeout_seconds: '30'
aliyun.scale: '1'
aliyun.rolling_updates: 'true'
aliyun.auto_scaling.max_cpu: '70'
aliyun.auto_scaling.min_cpu: '30'
aliyun.auto_scaling.step: '1'
aliyun.auto_scaling.max_instances: '10'
aliyun.auto_scaling.min_instances: '1'
oom-kill-disable: true
memswap_limit: 2000000000
shm_size: 67108864
memswap_reservation: 536870912
kernel_memory: 0
name: config
mem_limit: 536870912
cpu_shares: 50
cap_add:
- all
registry:
environment:
- CONFIG_SERVICE_PASSWORD=configPwd
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/registry:latest
hostname: registry
restart: always
depends_on:
- config
ports:
- '8761:8761'
logging:
options:
max-file: '10'
max-size: 10m
labels:
aliyun.scale: '1'
aliyun.routing.port_8761: eureka
memswap_limit: 0
shm_size: 0
memswap_reservation: 0
kernel_memory: 0
name: registry
gateway:
environment:
- CONFIG_SERVICE_PASSWORD=configPwd
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/gateway:latest
hostname: gateway
restart: always
depends_on:
- config
ports:
- '80:4000'
logging:
options:
max-file: '10'
max-size: 10m
labels:
aliyun.probe.url: 'http://container:4000/index.html'
aliyun.probe.initial_delay_seconds: '5'
aliyun.probe.timeout_seconds: '3'
aliyun.routing.session_sticky: 'true'
aliyun.scale: '1'
aliyun.routing.port_4000: gateway;gateway.swarm.piggymetrics.com
aliyun.rolling_updates: 'true'
aliyun.rolling_updates.parallelism: '2'
aliyun.auto_scaling.max_cpu: '70'
aliyun.auto_scaling.min_cpu: '30'
aliyun.auto_scaling.step: '1'
aliyun.auto_scaling.max_instances: '10'
aliyun.auto_scaling.min_instances: '1'
aliyun.log_store_requestlog: stdout # 采集stdout日志到requestlog日志库中
aliyun.log_ttl_requestlog: 30 # 设置requestlog日志库日志数据保存30天
aliyun.log.timestamp: true # Docker 在收集日志的时候可以选择是否添加 timestamp
external_links:
- auth-service.local
oom-kill-disable: true
memswap_limit: 2000000000
shm_size: 67108864
memswap_reservation: 536870912
kernel_memory: 0
name: gateway
mem_limit: 536870912
cpu_shares: 50
cap_add:
- all
auth-service:
environment:
- MONGODB_PASSWORD=mongodbPwd
- NOTIFICATION_SERVICE_PASSWORD=notificationPwd
- STATISTICS_SERVICE_PASSWORD=statisticsPwd
- ACCOUNT_SERVICE_PASSWORD=accountPwd
- CONFIG_SERVICE_PASSWORD=configPwd
- CLUSTER_NAME=$CLUSTER_NAME
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/auth-service:latest
command: ["java", "-Xmx200m", "-jar", "/app/auth-service.jar"]
restart: always
logging:
options:
max-file: '10'
max-size: 10m
labels:
aliyun.scale: '1'
aliyun.log_store_requestlog: stdout # 采集stdout日志到requestlog日志库中
aliyun.log_ttl_requestlog: 30 # 设置requestlog日志库日志数据保存30天
aliyun.log.timestamp: false # Docker 在收集日志的时候可以选择是否添加 timestamp
aliyun.routing.port_5000: auth-service.local
aliyun.depends: config
links:
- auth-mongodb
volumes:
- 'volume_name_piggymetrics:/data/oss:rw'
- 'VN_NAS_PIGGYMETRICS:/data/nas:rw'
- 'VN_YUNPAN_PIGGYMETRICS:/data/yunpan:rw'
- '/var/run/docker.sock:/var/run/docker.sock:rw'
memswap_limit: 0
shm_size: 0
memswap_reservation: 0
kernel_memory: 0
name: auth-service
cap_add:
- all
cap_drop:
- SETGID
- SETUID
auth-mongodb:
environment:
MONGODB_PASSWORD: $MONGODB_PASSWORD
constraint: group==db
image: registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/mongodb
restart: always
logging:
options:
max-size: 10m
max-file: '10'
devices:
- /dev/mem:/dev/mem
account-service:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
ACCOUNT_SERVICE_PASSWORD: $ACCOUNT_SERVICE_PASSWORD
MONGODB_PASSWORD: $MONGODB_PASSWORD
RDS_PASSWORD: $RDS_PASSWORD
RDS_URL: $RDS_URL
CLUSTER_NAME: $CLUSTER_NAME
affinity: service!=account-mongodb
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/account-service
hostname: account-service
restart: always
external_links:
- auth-service.local
links:
- account-mongodb:account-mongodb
- account-db:account-db
depends_on:
config:
condition: service_healthy
logging:
options:
max-size: 10m
max-file: '10'
labels:
aliyun.scale: '1'
aliyun.log_store_requestlog: stdout # 采集stdout日志到requestlog日志库中
aliyun.log_store_errorLog: /var/log/common/common_error.log # 采集error日志到requestlog日志库中
aliyun.log_store_monitorLog: /var/log/monitor/monitor_digest.log # 采集monitor_digest日志到requestlog日志库中
aliyun.log_ttl_requestlog: 30 # 设置requestlog日志库日志数据保存30天
aliyun.log.timestamp: true # Docker 在收集日志的时候可以选择是否添加 timestamp
account-db:
external:
host: $RDS_URL
ports:
- 3306
account-mongodb:
environment:
INIT_DUMP: account-service-dump.js
MONGODB_PASSWORD: $MONGODB_PASSWORD
constraint: group==db
image: registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/mongodb
restart: always
logging:
options:
max-size: 10m
max-file: '10'
statistics-service:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
MONGODB_PASSWORD: $MONGODB_PASSWORD
STATISTICS_SERVICE_PASSWORD: $STATISTICS_SERVICE_PASSWORD
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/statistics-service
hostname: statistics-service
external_links:
- auth-service.local
restart: always
depends_on:
config:
condition: service_healthy
logging:
options:
max-size: 10m
max-file: '10'
labels:
aliyun.log_store_requestlog: stdout # 采集stdout日志到requestlog日志库中
aliyun.log_ttl_requestlog: 30 # 设置requestlog日志库日志数据保存30天
aliyun.log.timestamp: true # Docker 在收集日志的时候可以选择是否添加 timestamp
statistics-mongodb:
environment:
MONGODB_PASSWORD: $MONGODB_PASSWORD
constraint: group==db
image: registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/mongodb
hostname: statistics-mongodb
restart: always
logging:
options:
max-size: 10m
max-file: '10'
notification-service:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
MONGODB_PASSWORD: $MONGODB_PASSWORD
NOTIFICATION_SERVICE_PASSWORD: $NOTIFICATION_SERVICE_PASSWORD
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/notification-service
hostname: notification-service
external_links:
- auth-service.local
restart: always
depends_on:
config:
condition: service_healthy
logging:
options:
max-size: 10m
max-file: '10'
labels:
aliyun.log_store_requestlog: stdout # 采集stdout日志到requestlog日志库中
aliyun.log_ttl_requestlog: 30 # 设置requestlog日志库日志数据保存30天
aliyun.log.timestamp: true # Docker 在收集日志的时候可以选择是否添加 timestamp
notification-mongodb:
image: registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/mongodb
hostname: notification-mongodb
restart: always
environment:
MONGODB_PASSWORD: $MONGODB_PASSWORD
constraint: group==db
logging:
options:
max-size: 10m
max-file: '10'
monitoring:
environment:
- CONFIG_SERVICE_PASSWORD=configPwd
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/monitoring:latest
hostname: monitoring
restart: always
depends_on:
- config
ports:
- '9000:9000'
logging:
options:
max-size: 10m
max-file: '10'
labels:
aliyun.scale: '1'
aliyun.routing.port_9000: hystrix
memswap_limit: 0
shm_size: 0
memswap_reservation: 0
kernel_memory: 0
name: monitoring
turbine-stream-service:
environment:
CONFIG_SERVICE_PASSWORD: $CONFIG_SERVICE_PASSWORD
image: >-
registry-vpc.cn-zhangjiakou.aliyuncs.com/goomoon-piggymetrics/turbine-stream-service
hostname: turbine-stream-service
restart: always
depends_on:
config:
condition: service_healthy
ports:
- '8989:8989'
logging:
options:
max-size: 10m
max-file: '10'