-
Notifications
You must be signed in to change notification settings - Fork 107
/
Copy pathdocker-compose.yml
97 lines (92 loc) · 2.06 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
version: '3'
# chmod 777 redis/redis.log
# chmod 777 redis/data
# chmod 777 mysql/data
services:
nginx:
build:
context: ./nginx
args:
NGINX_VERSION: $NGINX_VERSION
depends_on:
- php
ports:
- "80:80"
- "443:443"
volumes:
- ./www:/usr/share/nginx/html
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/cert:/etc/nginx/cert
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/log/error.log:/var/log/nginx/error.log
networks:
- frontend
restart: always
container_name: nginx
php:
build:
context: ./php
args:
PHP_VERSION: $PHP_VERSION
SWOOLE_VERSION: $SWOOLE_VERSION
AMQP_VERSION: $AMQP_VERSION
ports:
- "9501:9501"
volumes:
- ./www:/var/www/html
- ./php/config/php.ini:/usr/local/etc/php/php.ini
- ./php/config/php-fpm.conf:/usr/local/etc/php-fpm.conf
- ./php/config/php-fpm.d:/usr/local/etc/php-fpm.d
networks:
- frontend
- backend
restart: always
container_name: php
mysql:
build: ./mysql
ports:
- "3306:3306"
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/my.cnf:/etc/my.cnf
environment:
MYSQL_ROOT_PASSWORD: 123456
networks:
- backend
restart: always
container_name: mysql
redis:
build: ./redis
ports:
- "6379:6379"
volumes:
- ./redis/redis.conf/:/usr/local/etc/redis.conf
- ./redis/data:/usr/local/redis/data
- ./redis/redis.log:/usr/local/redis/redis.log
networks:
- backend
restart: always
container_name: redis
rabbitmq:
#容器名称
container_name: rabbitmq
#镜像名称
image: rabbitmq:3.8.3
#总是重启后启动
restart: always
#端口映射
ports:
- 5672:5672
- 15672:15672
#挂载
volumes:
- ./rabbitmq/data:/var/lib/rabbitmq
#环境变量
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=123456
networks:
- backend
networks:
frontend:
backend: