-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (84 loc) · 2.09 KB
/
docker-compose.yml
File metadata and controls
89 lines (84 loc) · 2.09 KB
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
version: '2'
services:
# 存储
volumes_www:
image: tianon/true
container_name: volumes_www
volumes:
- ./www:/var/www/html
- /etc/localtime:/etc/localtime
# 缓存
cache:
image: redis:alpine
container_name: cache-redis
ports:
- "6379:6379"
# 数据库
db:
image: mysql:latest
container_name: db-mysql
volumes:
# 数据库存储地址
- ./deploy/mysql/data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
#- MYSQL_DATABASE=database_name
#- MYSQL_USER=user
#- MYSQL_PASSWORD=password
ports:
# 允许客户端进入 3306
- "3306:3306"
depends_on:
- cache
restart: on-failure:3
# php-fpm
php-fpm:
build: deploy/php-fpm
container_name: php-fpm
volumes_from:
- volumes_www
volumes:
- ./deploy/php-fpm/config/php.ini:/usr/local/etc/php/php.ini
environment:
- REDIS_HOST=redis
# Set your APP env variables here:
# - APP_KEY=
# - DB_HOST=
# - DB_DATABASE=
# - DB_USERNAME=
# - DB_PASSWORD=
links:
- cache
- db
depends_on:
- cache
- db
ports:
- "9000"
restart: on-failure:3
# 网站服务
nginx:
image: nginx:alpine
container_name: nginx
volumes_from:
- volumes_www
volumes:
- ./deploy/nginx/conf.d:/etc/nginx/conf.d
- ./deploy/nginx/logs:/var/log/nginx
links:
- php-fpm
depends_on:
- php-fpm
ports:
- "80:80"
- "443:443"
restart: on-failure:3
# 安装 composer
# composer:
# image: composer/composer:alpine
# container_name: composer
# volumes:
# - ./www:/app
# depends_on:
# - php-fpm
# restart: 'no'