-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose-custom.yml
134 lines (125 loc) · 3.49 KB
/
docker-compose-custom.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
##
# docker-compose-custom.yml
#
## Just Use the build Section in service below, after that you can edit image in true docker-compose.yml
# $ dkc -f docker-compose-custom.yml build php-fpm
# $ dkc -f docker-compose-custom.yml build php-fpm-swoole
# $ dkc -f docker-compose-custom.yml build php-fpm-web
# $ dkc -f docker-compose-custom.yml build php-fpm-swoole-web
# $ dkc -f docker-compose-custom.yml build fe
# ```
#
# @license Apache-2.0
# @maintainer <github.com/farwish>
# @guide: https://docs.docker.com/compose/compose-file/
##
version: '3'
services:
mysql:
container_name: mysql-con
environment:
MYSQL_ROOT_PASSWORD: ${_MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${_MYSQL_DATABASE}
volumes:
- /etc/localtime:/etc/localtime
- ${DKC_AP}/etc/timezone:/etc/timezone
- /var/lib/docker/volumes/mysql:/var/lib/mysql
- ${DKC_AP}/mysql/mysql.conf.d:/etc/mysql/mysql.conf.d
ports:
- ${HOST_MYSQL_PORT}:3306
restart: on-failure
image: phvia/mysql:${IMG_MYSQL_VERSION} # For tag
networks:
- default_net
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile
args:
PHP_VERSION: ${IMG_PHP_VERSION}
container_name: php-fpm-con
volumes:
- /etc/localtime:/etc/localtime
- ${DKC_AP}/etc/timezone:/etc/timezone
- ${DKC_AP}/web:${CONTAINER_WEB_AP}
ports:
- ${HOST_PHP_PORT}:9000
depends_on:
- mysql
restart: on-failure
image: phvia/php:${IMG_PHP_VERSION}
networks:
- default_net
php-fpm-swoole:
build:
context: ./ext-swoole
dockerfile: Dockerfile-php-fpm-swoole
args:
PHP_VERSION: ${IMG_PHP_VERSION}
SWOOLE_VERSION: ${EXT_SWOOLE_VERSION}
container_name: php-fpm-swoole-con
volumes:
- /etc/localtime:/etc/localtime
- ${DKC_AP}/etc/timezone:/etc/timezone
- ${DKC_AP}/web:${CONTAINER_WEB_AP}
ports:
- ${HOST_PHP_PORT}:9000
depends_on:
- mysql
restart: on-failure
image: phvia/php:${IMG_PHP_VERSION}_${EXT_SWOOLE_VERSION}
networks:
- default_net
php-fpm-web:
build:
context: ./web
dockerfile: Dockerfile
args:
PHP_VERSION: ${IMG_PHP_VERSION}
WEB_PATH: ${CONTAINER_WEB_AP}
container_name: php-fpm-web-con
volumes:
- /etc/localtime:/etc/localtime
- ${DKC_AP}/etc/timezone:/etc/timezone
- ${DKC_AP}/web:${CONTAINER_WEB_AP}
ports:
- ${HOST_PHP_PORT}:9000
restart: on-failure
image: phvia/php:${IMG_PHP_VERSION}_web
networks:
- default_net
php-fpm-swoole-web:
build:
context: ./ext-swoole
dockerfile: Dockerfile-php-fpm-swoole-web
args:
PHP_VERSION: ${IMG_PHP_VERSION}
SWOOLE_VERSION: ${EXT_SWOOLE_VERSION}
WEB_PATH: ${CONTAINER_WEB_AP}
container_name: php-fpm-swoole-web-con
volumes:
- /etc/localtime:/etc/localtime
- ${DKC_AP}/etc/timezone:/etc/timezone
- ${DKC_AP}/web:${CONTAINER_WEB_AP}
restart: on-failure
image: phvia/php:${IMG_PHP_VERSION}_${EXT_SWOOLE_VERSION}_web
networks:
- default_net
fe:
build:
context: ./web
dockerfile: Dockerfile-fe
args:
PHP_VERSION: ${IMG_PHP_VERSION}
WEB_PATH: ${CONTAINER_WEB_AP}
container_name: fe-con
volumes:
- /etc/localtime:/etc/localtime
- ${DKC_AP}/etc/timezone:/etc/timezone
- ${DKC_AP}/web:${CONTAINER_WEB_AP}
image: phvia/fe:12.x
networks:
- default_net
networks:
default_net:
driver: bridge