-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdocker-compose-env.yml
165 lines (165 loc) · 5.17 KB
/
docker-compose-env.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
version: '3'
services:
mysql:
image: mysql:latest
container_name: mysql
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: root #设置root帐号密码
ports:
- 3306:3306
volumes:
- /mydata/mysql/data/db:/var/lib/mysql #数据文件挂载
- /mydata/mysql/data/conf:/etc/mysql/conf.d #配置文件挂载
- /mydata/mysql/log:/var/log/mysql #日志文件挂载
mysql-slave01:
image: mysql:latest
container_name: mysql-slave01
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: root #设置root帐号密码
ports:
- 3308:3306
volumes:
- /mydata/mysql-slave01/data/db:/var/lib/mysql #数据文件挂载
- /mydata/mysql-slave01/data/conf:/etc/mysql/conf.d #配置文件挂载
- /mydata/mysql-slave01/log:/var/log/mysql #日志文件挂载
depends_on:
- mysql
links:
- mysql
mysql-slave02:
image: mysql:latest
container_name: mysql-slave02
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: root #设置root帐号密码
ports:
- 3310:3306
volumes:
- /mydata/mysql-slave02/data/db:/var/lib/mysql #数据文件挂载
- /mydata/mysql-slave02/data/conf:/etc/mysql/conf.d #配置文件挂载
- /mydata/mysql-slave02/log:/var/log/mysql #日志文件挂载
depends_on:
- mysql
links:
- mysql
redis:
image: redis:latest
container_name: redis
command: redis-server --appendonly yes --requirepass "redis-psd"
volumes:
- /mydata/redis/data:/data #数据文件挂载
ports:
- 6379:6379
redis-slave1:
image: redis:latest
container_name: redis-slave1
command: redis-server --slaveof redis 6379 --masterauth "redis-psd" --appendonly yes --requirepass "redis-psd"
volumes:
- /mydata/redis-slave1/data:/data #数据文件挂载
depends_on:
- redis
ports:
- 6378:6379
links:
- redis
redis-slave2:
image: redis:latest
container_name: redis-slave2
command: redis-server --slaveof redis 6379 --masterauth "redis-psd" --appendonly yes --requirepass "redis-psd"
volumes:
- /mydata/redis-slave2/data:/data #数据文件挂载
depends_on:
- redis
ports:
- 6380:6379
links:
- redis
nginx:
image: nginx:latest
container_name: nginx
volumes:
- /mydata/nginx/nginx.conf:/etc/nginx/nginx.conf #配置文件挂载
- /mydata/nginx/html:/usr/share/nginx/html #静态资源根目录挂载
- /mydata/nginx/log:/var/log/nginx #日志文件挂载
ports:
- 80:80
rabbitmq:
image: rabbitmq:3.12.6-management
container_name: rabbitmq
volumes:
- /mydata/rabbitmq/data:/var/lib/rabbitmq #数据文件挂载
- /mydata/rabbitmq/log:/var/log/rabbitmq #日志文件挂载
ports:
- 5672:5672
- 15672:15672
rabbitmq-p2:
image: rabbitmq:3.12.6-management
container_name: rabbitmq-p2
volumes:
- /mydata/rabbitmq-p2/data:/var/lib/rabbitmq #数据文件挂载
- /mydata/rabbitmq-p2/log:/var/log/rabbitmq #日志文件挂载
ports:
- 5674:5672
- 15674:15672
rabbitmq-p3:
image: rabbitmq:3.12.6-management
container_name: rabbitmq-p3
volumes:
- /mydata/rabbitmq-p3/data:/var/lib/rabbitmq #数据文件挂载
- /mydata/rabbitmq-p3/log:/var/log/rabbitmq #日志文件挂载
ports:
- 5676:5672
- 15676:15672
elasticsearch:
image: elasticsearch:7.14.2
container_name: elasticsearch
user: root
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discovery.type=single-node" #以单一节点模式启动
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" #设置使用jvm内存大小
volumes:
- /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins #插件文件挂载
- /mydata/elasticsearch/data:/usr/share/elasticsearch/data #数据文件挂载
ports:
- 9200:9200
- 9300:9300
logstash:
image: logstash:7.14.2
container_name: logstash
environment:
- TZ=Asia/Shanghai
volumes:
- /mydata/logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf #挂载logstash的配置文件
depends_on:
- elasticsearch #kibana在elasticsearch启动之后再启动
links:
- elasticsearch:es #可以用es这个域名访问elasticsearch服务
ports:
- 4560:4560
- 4561:4561
- 4562:4562
- 4563:4563
kibana:
image: kibana:7.14.2
container_name: kibana
links:
- elasticsearch:es #可以用es这个域名访问elasticsearch服务
depends_on:
- elasticsearch #kibana在elasticsearch启动之后再启动
environment:
- "elasticsearch.hosts=http://es:9200" #设置访问elasticsearch的地址
ports:
- 5601:5601
mongo:
image: mongo:latest
container_name: mongo
volumes:
- /mydata/mongo/db:/data/db #数据文件挂载
ports:
- 27017:27017