-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
158 lines (157 loc) · 4.54 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '2.0'
services:
php-base:
# {{{
build: dockerfiles/php/7.2/base
image: php72-base
container_name: ${ENV_SERVICES_PREFIX}php72-base
networks:
- backend
- frontend
depends_on:
- "mysql"
- "memcached"
- "redis"
volumes:
- ${ENV_WEB_BASE_PATH}${ENV_WEB_ROOT_PATH}:/web/
extra_hosts:
- "websocket.local.com:${ENV_NGINX_IP}"
entrypoint: /bin/sh -c "while true; do echo 'hello codezm!'; sleep 1; done"
restart: always
# }}}
php-fpm:
# {{{
build: dockerfiles/php/7.1/fpm
image: php71-fpm
container_name: ${ENV_SERVICES_PREFIX}php71-fpm
networks:
- backend
- frontend
depends_on:
- "mysql"
- "memcached"
- "redis"
volumes:
- ${ENV_WEB_BASE_PATH}${ENV_WEB_ROOT_PATH}:/web/
extra_hosts:
- "websocket.local.com:${ENV_NGINX_IP}"
restart: always
# }}}
php-cli:
# {{{
build: dockerfiles/php/7.1/cli
image: php71-cli
container_name: ${ENV_SERVICES_PREFIX}php71-cli
networks:
- backend
- frontend
depends_on:
- "mysql"
- "memcached"
- "redis"
volumes:
- ${ENV_WEB_BASE_PATH}${ENV_WEB_ROOT_PATH}:/web/
extra_hosts:
- "websocket.local.com:${ENV_NGINX_IP}"
restart: always
command: ["/web/websocketServer.php"]
# }}}
nginx:
# {{{
build: dockerfiles/nginx
image: nginx
container_name: ${ENV_SERVICES_PREFIX}nginx
hostname: nginx
depends_on:
- "php-fpm"
- "php-cli"
volumes_from:
- php-fpm
volumes:
# Nginx configurate.
#- "${ENV_WEB_BASE_PATH}${ENV_WEB_CONFIG_PATH}nginx/nginx.conf:/etc/nginx/nginx.conf"
#- "${ENV_WEB_BASE_PATH}${ENV_WEB_CONFIG_PATH}nginx/enable-phpfpm.conf:/etc/nginx/enable-phpfpm.conf"
- "${ENV_WEB_BASE_PATH}${ENV_WEB_CONFIG_PATH}nginx/conf.d/:/etc/nginx/conf.d/"
# Logs.
- "${ENV_WEB_BASE_PATH}${ENV_WEB_LOG_PATH}nginx/:/var/log/nginx/"
ports:
- "80:80"
#- "443:443"
restart: always
networks:
frontend:
ipv4_address: ${ENV_NGINX_IP}
# }}}
mysql:
# {{{
build: dockerfiles/mysql/debian/8.0
image: mysql:debian
container_name: ${ENV_SERVICES_PREFIX}mysql
hostname: mysql
depends_on:
#- alpine
- debian
volumes:
- "${ENV_WEB_BASE_PATH}${ENV_WEB_MYSQL_DATABASE_PATH}:/var/lib/mysql"
#- "${ENV_WEB_BASE_PATH}${ENV_WEB_CONFIG_PATH}mysql/alpine/my.cnf:/etc/mysql/my.cnf"
#- "${ENV_WEB_BASE_PATH}${ENV_WEB_CONFIG_PATH}mysql/debian/my.cnf:/etc/mysql/my.cnf"
environment:
- "MYSQL_ROOT_PASSWORD=1234"
ports:
- "3306:3306"
networks:
- backend
#command: ['--datadir=/mysql-data','--user=mysql']
restart: always
# }}}
memcached:
# {{{
build: dockerfiles/memcached
image: memcached
container_name: ${ENV_SERVICES_PREFIX}memcached
hostname: memcached
depends_on:
- alpine
ports:
- "11211:11211"
networks:
- backend
restart: always
#command: ["-m", "64", "-p", "11211"]
# }}}
redis:
# {{{
build: dockerfiles/redis
image: redis
container_name: ${ENV_SERVICES_PREFIX}redis
hostname: redis
depends_on:
- alpine
ports:
- "6379:6379"
networks:
- backend
restart: always
# }}}
alpine:
# {{{
build: dockerfiles/alpine
image: codezm/alpine:3.4
container_name: ${ENV_SERVICES_PREFIX}test
command: /bin/sh -c "while true; do echo 'hello codezm!'; sleep 1; done"
# }}}
debian:
# {{{
build: dockerfiles/debian
image: codezm/debian:jessie
container_name: ${ENV_SERVICES_PREFIX}debian
hostname: debian-codezm-hostname
domainname: debian-codezm-domainname
command: /bin/bash -c "while true; do echo 'hello codezm!'; sleep 1; done"
# }}}
networks:
frontend:
ipam:
config:
- subnet: 172.0.0.0/16
backend: