-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
79 lines (75 loc) · 1.7 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
version: "3"
services:
php:
container_name: dev-php
build: ./php-fpm/
restart: always
links:
- mysql
- redis
expose:
- 9000
ports:
- 19000:9000
volumes:
- $WWW_DIR:/var/www/
# - $PHP_FPM_DIR/conf:/usr/local/etc/
networks:
- app_net
nginx:
container_name: dev-nginx
# image: nginx:1.23.3
build: ./nginx/
restart: always
links:
- php:php-fpm
expose:
- 80
ports:
- 6380:80
depends_on:
- php
volumes:
- $NGINX_DIR/conf.d:/etc/nginx/conf.d
- $NGINX_DIR/nginx.conf:/etc/nginx/nginx.conf
- $NGINX_DIR/fastcgi.conf:/etc/nginx/fastcgi.conf
- $NGINX_DIR/pathinfo.conf:/etc/nginx/pathinfo.conf
- $NGINX_DIR/log:/etc/nginx/log
- $NGINX_DIR/html:/usr/share/nginx/html
- $WWW_DIR:/var/www # 同一个宿主机目录 映射到 不同容器的相同路径的目录
networks:
- app_net
mysql:
container_name: dev-mysql
image: mysql:5.7
restart: always
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 'root'
privileged: true
command: --default-authentication-plugin=mysql_native_password
volumes:
- $MYSQL_DIR/conf.d:/etc/mysql/conf.d
- $MYSQL_DIR/data:/var/lib/mysql
- $MYSQL_DIR/log:/var/log/mysql
expose:
- 3306
ports:
- 13306:3306
networks:
- app_net
redis:
container_name: dev-redis
image: redis
restart: always
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- $REDIS_CONF_FILE:/usr/local/etc/redis/redis.conf
expose:
- 6379
ports:
- 16379:6379
networks:
- app_net
networks:
app_net: