-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
288 lines (281 loc) · 6.48 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
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
version: '3'
services:
# 基础环境
nginx:
container_name: mymall-nginx
image: jahentao/mymall-nginx:1
ports:
- "80:80"
extra_hosts:
- "MYHOST:${MYHOST}"
- "dubbo-admin.mymall.com:${MYHOST}"
- "manage.mymall.com:${MYHOST}"
- "item.mymall.com:${MYHOST}"
- "mymall.com:${MYHOST}"
- "www.mymall.com:${MYHOST}"
- "image.mymall.com:${MYHOST}"
- "static.mymall.com:${MYHOST}"
- "sso.mymall.com:${MYHOST}"
- "order.mymall.com:${MYHOST}"
- "solr.mymall.com:${MYHOST}"
- "search.mymall.com:${MYHOST}"
- "cart.mymall.com:${MYHOST}"
# 3个zookeeper构成的集群
zookeeper:
image: zookeeper
restart: always
hostname: zookeeper
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zookeeper2:2888:3888 server.3=zookeeper3:2888:3888
zookeeper2:
image: zookeeper
restart: always
hostname: zookeeper2
ports:
- 2182:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zookeeper:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zookeeper3:2888:3888
zookeeper3:
image: zookeeper
restart: always
hostname: zookeeper3
ports:
- 2183:2181
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zookeeper:2888:3888 server.2=zookeeper2:2888:3888 server.3=0.0.0.0:2888:3888
redis:
container_name: mymall-redis
image: redis:3.2
ports:
- "6379:6379"
db:
container_name: mymall-mysql
image: jahentao/mymall-mysql:1
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: mymall
MYSQL_ROOT_PASSWORD: 123456
MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai
solr:
container_name: mymall-solr
image: jahentao/mymall-solr:1
ports:
- "8983:8983"
activemq:
container_name: mymall-activemq
image: webcenter/activemq:5.14.3
ports:
- "61616:61616"
- "8161:8161"
# 搞不定,fastdfs以docker-compose启动,配置哪里不对,上传文件用不了
# fastdfs-tracker:
# container_name: mymall-fastdfs-tracker
# image: morunchang/fastdfs
# command: sh tracker.sh
# ports:
# - "22122:22122"
# - "8080:8080"
# fastdfs-storage:
# container_name: mymall-fastdfs-storage
# build:
# context: ./mymall-fastdfs-storage
# image: mymall-fastdfs-storage:1
# environment:
# # IP 需要修改
# TRACKER_IP: fastdfs-tracker:22122
# GROUP_NAME: group1
# command: sh storage.sh
# ports:
# - "23000:23000"
# 这个端口要修改,暂时不要用文件下载
# - "80:80"
# 应用服务,依赖基础环境
# docker-compose stop manager-service content-service search-service sso-service cart-service order-service
# docker-compose start manager-service content-service search-service sso-service cart-service order-service
manager-service:
container_name: mymall-manager-service
image: jahentao/mymall-manager-service:1
ports:
- "20880:20880"
depends_on:
- db
- redis
- activemq
- zookeeper
links:
- zookeeper
- activemq
- redis
- db:mysql
content-service:
container_name: mymall-content-service
image: jahentao/mymall-content-service:1
ports:
- "20881:20881"
depends_on:
- db
- redis
- zookeeper
links:
- db:mysql
- redis
- zookeeper
search-service:
container_name: mymall-search-service
image: jahentao/mymall-search-service:1
ports:
- "20882:20882"
depends_on:
- db
- solr
- activemq
- zookeeper
links:
- db:mysql
- activemq
- zookeeper
- solr
sso-service:
container_name: mymall-sso-service
image: jahentao/mymall-sso-service:1
ports:
- "20883:20883"
depends_on:
- db
- redis
- zookeeper
links:
- db:mysql
- redis
- zookeeper
cart-service:
container_name: mymall-cart-service
image: jahentao/mymall-cart-service:1
ports:
- "20884:20884"
depends_on:
- db
- redis
- zookeeper
links:
- db:mysql
- redis
- zookeeper
order-service:
container_name: mymall-order-service
image: jahentao/mymall-order-service:1
ports:
- "20885:20885"
depends_on:
- db
- redis
- zookeeper
links:
- db:mysql
- redis
- zookeeper
# Dubbo监控
dubbo-admin:
container_name: mymall-app-dubbo-admin
image: jahentao/mymall-dubbo-admin:1
ports:
- "7001:7001"
depends_on:
- zookeeper
links:
- zookeeper
# Web应用
# docker-compose stop manager-web portal-web search-web item-web sso-web cart-web order-web
# docker-compose start manager-web portal-web search-web item-web sso-web cart-web order-web
manager-web:
container_name: mymall-app-manager-web
image: jahentao/mymall-manager-web:1
ports:
- "8081:8081"
depends_on:
- zookeeper
- content-service
- manager-service
- search-service
links:
- zookeeper
portal-web:
container_name: mymall-app-portal-web
image: jahentao/mymall-portal-web:1
ports:
- "8082:8082"
depends_on:
- zookeeper
- content-service
links:
- zookeeper
search-web:
container_name: mymall-app-search-web
image: jahentao/mymall-search-web:1
ports:
- "8083:8083"
depends_on:
- zookeeper
- redis
- search-service
links:
- zookeeper
item-web:
container_name: mymall-app-item-web
image: jahentao/mymall-item-web:1
ports:
- "8084:8084"
depends_on:
- zookeeper
- activemq
- manager-service
links:
- activemq
- zookeeper
sso-web:
container_name: mymall-app-sso-web
image: jahentao/mymall-sso-web:1
ports:
- "8085:8085"
depends_on:
- zookeeper
- sso-service
links:
- zookeeper
cart-web:
container_name: mymall-app-cart-web
image: jahentao/mymall-cart-web:1
ports:
- "8086:8086"
depends_on:
- zookeeper
- cart-service
- manager-service
- sso-service
links:
- zookeeper
order-web:
container_name: mymall-app-order-web
image: jahentao/mymall-order-web:1
ports:
- "8087:8087"
depends_on:
- zookeeper
- cart-service
- order-service
- sso-service
links:
- zookeeper
#networks:
# frontend:
# backend:
#
#volumes:
# db-data:s