-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.sample.yml
executable file
·308 lines (292 loc) · 7.82 KB
/
docker-compose.sample.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
version: '2'
services:
php56:
build: ./build/php/php56/
ports:
- "9010:9000"
privileged: true
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./logs/php56:/var/log/php-fpm:rw
- ./conf/php56/php/php.ini:/usr/local/etc/php/php.ini:rw
- ./conf/php56/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
restart: always
command: php-fpm
networks:
default:
ipv4_address: 172.19.0.56
# container_name: "compose_php_php56"
php71:
build: ./build/php/php71/
ports:
- "9020:9000"
privileged: true
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./logs/php71:/var/log/php-fpm:rw
- ./conf/php71/php/php.ini:/usr/local/etc/php/php.ini:rw
- ./conf/php71/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
restart: always
command: php-fpm
networks:
default:
ipv4_address: 172.19.0.71
# container_name: "compose_php_php71"
php72:
build: ./build/php/php72/
ports:
- "9030:9000"
- "9501:9501"
privileged: true
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./logs/php72:/var/log/php-fpm:rw
- ./conf/php72/php/php.ini:/usr/local/etc/php/php.ini:rw
- ./conf/php72/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
restart: always
command: php-fpm
networks:
default:
ipv4_address: 172.19.0.72
# container_name: "compose_php_php71"
php73:
build: ./build/php/php73/
ports:
- "9040:9000"
- "9511:9511"
privileged: true
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./logs/php73:/var/log/php-fpm:rw
- ./conf/php73/php/php.ini:/usr/local/etc/php/php.ini:rw
- ./conf/php73/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
restart: always
command: php-fpm
networks:
default:
ipv4_address: 172.19.0.73
# container_name: "compose_php_php73"
php74:
build: ./build/php/php74/
ports:
- "9074:9000"
- "9621:9501"
privileged: true
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./logs/php74:/var/log/php-fpm:rw
- ./conf/php74/php/php.ini:/usr/local/etc/php/php.ini:rw
- ./conf/php74/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
restart: always
command: php-fpm
networks:
default:
ipv4_address: 172.19.0.74
# container_name: "compose_php_php74"
php80:
build: ./build/php/php80/
ports:
- "9084:9000"
- "9631:9501"
privileged: true
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./logs/php80:/var/log/php-fpm:rw
- ./conf/php80/php/php.ini:/usr/local/etc/php/php.ini:rw
- ./conf/php80/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
restart: always
command: php-fpm
networks:
default:
ipv4_address: 172.19.0.75
# container_name: "compose_php_php74"
nginx:
build: ./build/nginx
depends_on:
- php56
- php71
- php72
- php73
volumes:
- ${SOURCE_DIR}:/var/www:rw
- ./conf/nginx/conf.d:/etc/nginx/conf.d:rw
- ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf:rw
- ./logs/nginx:/var/log/nginx:rw
ports:
- "80:80"
- "443:443"
privileged: true
restart: always
command: nginx -g 'daemon off;'
networks:
default:
ipv4_address: 172.19.0.2
# 容器名称
#container_name: "compose-nginx"
minio:
image: minio/minio
ports:
- "9100:9000" # api 端口
- "9101:9001" # 控制台端口
environment:
- MINIO_ROOT_USER=admin
- MINIO_ROOT_PASSWORD=12345678
# - MINIO_ACCESS_KEY: admin #管理后台用户名
# - MINIO_SECRET_KEY: admin123 #管理后台密码,最小8个字符
volumes:
- ./data/minio:/data #映射当前目录下的data目录至容器内/data目录
- ./conf/minio:/root/.minio/ #映射配置目录
command: server --console-address ':9001' /data #指定容器中的目录 /data
mysql:
build: ./build/mysql
ports:
- "3306:3306"
privileged: true
volumes:
- ./logs/mysql:/var/lib/mysql-logs:rw
- ./conf/mysql/conf.d:/etc/mysql/conf.d:rw
environment:
MYSQL_ROOT_PASSWORD: 123456
MYSQL_DATABASE: testdb
MYSQL_USER: test
MYSQL_PASSWORD: 123456
restart: always
command: --default-authentication-plugin=mysql_native_password
# command: "--character-set-server=utf8"
networks:
default:
ipv4_address: 172.19.0.36
# 固定子网ip,网段必须在子网络10.10.*.*
#ipv4_address: 127.20.0.1
#container_name: "compose-mysql"
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
ports:
- "8080:80"
volumes:
- ./conf/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:rw
- ./conf/phpmyadmin/php-phpmyadmin.ini:/usr/local/etc/php/conf.d/php-phpmyadmin.ini:rw
networks:
- default
environment:
- PMA_HOST=mysql
- PMA_PORT=3306
- TZ=Asia/Shanghai
redis:
build: ./build/redis
ports:
- "6379:6379"
privileged: true
volumes:
- ./data/redis:/data
- ./conf/redis/redis.conf:/etc/redis.conf:rw
restart: always
entrypoint: ["redis-server", "/etc/redis.conf"]
networks:
default:
ipv4_address: 172.19.0.79
phpredisadmin:
image: erikdubbelboer/phpredisadmin:latest
container_name: phpredisadmin
ports:
- "8081:80"
networks:
- default
environment:
- REDIS_1_HOST=redis
- REDIS_1_PORT=6379
- TZ=Asia/Shanghai
mongodb:
build: ./build/mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: "root"
MONGO_INITDB_ROOT_PASSWORD: "123456"
volumes:
- ./data/mongodb:/data/db:rw
- ./data/mongodb/mongo_key:/mongo:rw
ports:
- "27017:27017"
privileged: true
networks:
- default
command:
--auth
adminmongo:
image: mrvautin/adminmongo
container_name: adminmongo
ports:
- "1234:1234"
environment:
- HOST=0.0.0.0
- DB_HOST=mongodb
- DB_PORT=27017
networks:
- default
elasticsearch:
build: ./build/elasticsearch
environment:
- cluster.name=docker-cluster
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
volumes:
- ./data/elasticsearch:/usr/share/elasticsearch/data
- ./conf/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- ./logs/elasticsearch:/usr/share/elasticsearch/logs
hostname: elasticsearch
restart: always
ports:
- "9200:9200"
- "9300:9300"
networks:
default:
ipv4_address: 172.19.0.92
kibana:
build: ./build/kibana
environment:
elasticsearch.hosts: http://elasticsearch:9200
i18n.locale: "zh-CN"
volumes:
- ./conf/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml
hostname: kibana
depends_on:
- elasticsearch
restart: always
ports:
- "5601:5601"
networks:
default:
ipv4_address: 172.19.0.57
logstash:
build: ./build/logstash
command: logstash -f ./conf/logstash-filebeat.conf
volumes:
# 映射到容器中
- ./conf/logstash/logstash-filebeat.conf:/usr/share/logstash/conf/logstash-filebeat.conf
environment:
- elasticsearch.hosts=http://elasticsearch:9200
hostname: logstash
restart: always
depends_on:
- elasticsearch
ports:
- "9600:9600"
- "5044:5044"
networks:
default:
ipv4_address: 172.19.0.96
memcached:
build: ./build/memcached
restart: always
ports:
- "11221:11211"
networks:
default:
ipv4_address: 172.19.0.11
networks:
# 配置docker network
default:
driver: bridge
ipam:
config:
- subnet: 172.19.0.0/16