forked from gnulife/dphp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
73 lines (67 loc) · 1.46 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
version: '2'
services:
# 公共镜像,只配置了国内镜像加速和中国时区配置
alpine:
build: alpine
image: water/alpine
mysql:
build: mysql
image: water/mysql
depends_on:
- "alpine"
volumes:
- "./volumes/mysql:/apps/mysql"
ports:
- "3306:3306"
environment:
# 默认的root密码和需要新建的数据库、用户名、密码,若需要重新设置,需要删除volumes/mysql/下面的全部内容,然后重新build
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=your_db_name
- MYSQL_USER=developer
- MYSQL_PASSWORD=developer
restart: always
redis:
build: redis
image: water/redis
depends_on:
- "alpine"
ports:
- "6379:6379"
restart: always
# php5配置
# phpfpm:
# build: phpfpm
# image: water/phpfpm
# depends_on:
# - "alpine"
# links:
# - mysql
# - redis
# volumes:
# - "./volumes/apps:/apps"
# restart: always
# php7配置
phpfpm7:
build: phpfpm7
image: water/phpfpm7
depends_on:
- "alpine"
links:
- mysql
- redis
volumes:
- "./volumes/apps:/apps"
restart: always
# 切换php版本时,请注意修改下面nginx相应的服务别名配置
nginx:
build: nginx
image: water/nginx
depends_on:
- "alpine"
links:
- phpfpm7:phpfpm
volumes_from:
- phpfpm7
ports:
- "80:80"
restart: always