-
Notifications
You must be signed in to change notification settings - Fork 471
/
docker-compose.yml
313 lines (295 loc) · 7.56 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
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
version: "3"
services:
rabbitmq-management:
image: rabbitmq:3-management
container_name: rabbitmq
restart: always
ports:
- "5672:5672"
- "15672:15672"
networks:
- somenetwork
nacos:
container_name: nacos
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
# - NACOS_AUTH_IDENTITY_KEY=nacos
# - NACOS_AUTH_IDENTITY_VALUE=my-nacos
# - NACOS_AUTH_TOKEN=123456
- NACOS_AUTH_ENABLE=true
volumes:
- ./doc/docker/nacos/standalone-logs/:/home/nacos/standalone-logs
- ./doc/docker/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties
- ./doc/docker/nacos/conf/application.properties:/home/nacos/conf/application.properties
ports:
- "8848:8848"
- "9848:9848"
restart: always
build:
context: ./doc/docker/nacos
networks:
- somenetwork
prometheus:
container_name: prometheus
image: prom/prometheus:latest
volumes:
- ./doc/docker/nacos/prometheus/prometheus-standalone.yaml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
depends_on:
- nacos
restart: on-failure
networks:
- somenetwork
grafana:
container_name: grafana
image: grafana/grafana:latest
ports:
- 3000:3000
restart: on-failure
networks:
- somenetwork
nginx:
image: nginx
container_name: nginx
volumes:
- ./doc/docker/nginx/templates:/etc/nginx/templates
ports:
- "80:80"
environment:
- NGINX_HOST=foobar.com
- NGINX_PORT=80
zookeeper:
image: zookeeper:3.6.2
container_name: zookeeper
restart: always
ports:
- "2181:2181"
networks:
- somenetwork
kafka:
image: bitnami/kafka:3.1.1
container_name: kafka
ports:
- "9092:9092"
- "1099:1099"
environment:
KAFKA_ADVERTISED_HOST_NAME: "kafka"
KAFKA_ADVERTISED_PORT: "9092"
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
#自动创建topic,goodskill-kafka:12:1表示创建“goodskill-kafka”topic,12个分区,1个副本
KAFKA_CREATE_TOPICS: "goodskill-kafka:12:1"
JMX_PORT: "1099"
KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.rmi.port=1099"
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_BROKER_ID: "1"
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092"
KAFKA_CFG_ADVERTISED_LISTENERS: "PLAINTEXT://127.0.0.1:9092"
depends_on:
- zookeeper
restart: always
networks:
- somenetwork
kafka-manager:
image: kafkamanager/kafka-manager:latest
container_name: kafkamanager
restart: always
ports:
- "9001:9000"
environment:
- ZK_HOSTS=zookeeper:2181
depends_on:
- zookeeper
- kafka
networks:
- somenetwork
redis:
image: redis
container_name: redis
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- "6379:6379"
networks:
- somenetwork
command: [ "redis-server", "--appendonly", "yes", "--requirepass", "123456" ]
redisinsight:
image: redislabs/redisinsight:latest
container_name: redisinsight
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- "8001:8001"
networks:
- somenetwork
elasticsearch:
image: elasticsearch:7.16.2
container_name: elasticsearch
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discovery.type=single-node" #以单一节点模式启动
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" #设置使用jvm内存大小
volumes:
- ./doc/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins #插件文件挂载
# - ./doc/docker/elasticsearch/data:/usr/share/elasticsearch/data #数据文件挂载
ports:
- "9200:9200"
- "9300:9300"
networks:
- somenetwork
kibana:
image: kibana:7.16.2
container_name: kibana
depends_on:
- elasticsearch
environment:
- "elasticsearch.hosts=https://elasticsearch:9200" #设置访问elasticsearch的地址
ports:
- "5601:5601"
networks:
- somenetwork
logstash:
image: logstash:7.16.2
container_name: logstash
volumes:
- ./doc/docker/logstash/logstash-springboot.conf:/usr/share/logstash/pipeline/logstash.conf #挂载logstash的配置文件
depends_on:
- elasticsearch
ports:
- "4560:4560"
networks:
- somenetwork
mysql:
image: mysql:8.0.29
container_name: mysql
restart: always
ports:
- "3306:3306"
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_0900_ai_ci
--lower-case-table-names=1
volumes:
- ./goodskill-web/src/main/sql:/docker-entrypoint-initdb.d/
environment:
MYSQL_ROOT_PASSWORD: "Password123"
MYSQL_DATABASE: "seckill"
MYSQL_USER: "seckill"
MYSQL_PASSWORD: "Password123"
networks:
- somenetwork
mongo:
image: mongo:6.0.7
container_name: mongo
restart: always
ports:
- "27017:27017"
networks:
- somenetwork
# environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: root
seata-server:
image: seataio/seata-server:2.0.0
container_name: seata-server
hostname: seata-server
ports:
- "8091:8091"
- "7091:7091"
environment:
# 注册到nacos上的ip。客户端将通过该ip访问seata服务。
# 注意公网ip和内网ip的差异。
- SEATA_IP=192.168.0.103
- SEATA_PORT=8091
# - STORE_MODE=db
# - SEATA_CONFIG_NAME=file:/root/seata-config/registry.conf
volumes:
- ./doc/docker/seata/resources/application.yml:/seata-server/resources/application.yml
networks:
- somenetwork
# goodses:
# build: ./goodskill-es-provider
# container_name: goodses
# volumes:
# - /logs/goods-es/:/logs/goodskill
# depends_on:
# - elasticsearch
# - nacos
## - elasticsearch1
# networks:
# - somenetwork
#
# goodsservice:
# build: ./goodskill-spring-boot-provider
# container_name: goodsservice
# restart: on-failure:3
# volumes:
# - /logs/goods-service/:/logs/goodskill
# depends_on:
# - elasticsearch
# - zookeeper
# - goodsmongo
# - goodses
# - redis
# - nacos
## - seata-server
# networks:
# - somenetwork
#
# goodsweb:
# build: ./goodskill-web
# container_name: goodsweb
# restart: on-failure:5
# volumes:
# - /logs/goods-web/:/logs/goodskill
# depends_on:
# - goodsservice
# - zookeeper
# - redis
# - nacos
# networks:
# - somenetwork
#
# goodsgateway:
# build: ./goodskill-gateway
# container_name: goodsgateway
# restart: on-failure:3
# volumes:
# - /logs/goods-gateway/:/logs/goodskill
# ports:
# - "80:80"
# depends_on:
# - nacos
# networks:
# - somenetwork
#
## goodsseata:
## build: ./goodskill-seata
## container_name: goodsseata
## restart: on-failure:3
## volumes:
## - /logs/goods-seata/:/logs/goodskill
## depends_on:
## - seata-server
## - goodsservice
## networks:
## - somenetwork
#
# goodsadmin:
# build: ./goodskill-admin
# container_name: goodsadmin
# ports:
# - "8083:8083"
# volumes:
# - /logs/goods-admin/:/logs/goodskill
# depends_on:
# - nacos
# networks:
# - somenetwork
networks:
somenetwork:
driver: bridge