-
Notifications
You must be signed in to change notification settings - Fork 62
/
docker-compose.yml
259 lines (244 loc) · 8.22 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
version: "3"
networks:
frontend:
driver: ${NETWORKS_DRIVER}
backend:
driver: ${NETWORKS_DRIVER}
volumes:
mysql:
driver: ${VOLUMES_DRIVER}
memcached:
driver: ${VOLUMES_DRIVER}
redis:
driver: ${VOLUMES_DRIVER}
mongo:
driver: ${VOLUMES_DRIVER}
phpmyadmin:
driver: ${VOLUMES_DRIVER}
elasticsearch:
driver: ${VOLUMES_DRIVER}
adminer:
driver: ${VOLUMES_DRIVER}
services:
### Docker-in-Docker ################################################
docker-in-docker:
image: docker:dind
privileged: true
volumes:
- ${APP_CODE_LOCAL_PATH}:${APP_CODE_CONTAINER_PATH}
expose:
- 2375
networks:
- backend
### Workspace Utilities Container ###########################
workspace:
build:
context: ./workspace
args:
- PHP_VERSION=${PHP_VERSION}
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
- INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP}
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
- INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO}
- INSTALL_SWOOLE=${WORKSPACE_INSTALL_SWOOLE}
- INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH}
- PUID=${WORKSPACE_PUID}
- PGID=${WORKSPACE_PGID}
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
- YARN_VERSION=${WORKSPACE_YARN_VERSION}
- TZ=${WORKSPACE_TIMEZONE}
links:
- docker-in-docker
volumes:
- ${APP_CODE_LOCAL_PATH}:${APP_CODE_CONTAINER_PATH}${APP_CODE_CONTAINER_FLAG}
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
tty: true
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
- DOCKER_HOST=tcp://docker-in-docker:2375
networks:
- frontend
- backend
### PHP-FPM Container #######################################
php-fpm:
build:
context: ./php-fpm
args:
- PHP_VERSION=${PHP_VERSION}
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}
- INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP}
- INSTALL_ZIP_ARCHIVE=${PHP_FPM_INSTALL_ZIP_ARCHIVE}
- INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS}
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
- INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO}
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
volumes:
- ./php-fpm/php.ini:/usr/local/etc/php/php.ini
- ./php-fpm/xdebug.ini:/etc/php/7.1/cli/conf.d/xdebug.ini
- ./php-fpm/site.ini:/usr/local/etc/php/conf.d/site.ini
- ./php-fpm/site.pool.ini:/usr/local/etc/php-fpm.d/site.pool.ini
- ${APP_CODE_LOCAL_PATH}:${APP_CODE_CONTAINER_PATH}${APP_CODE_CONTAINER_FLAG}
expose:
- "9000"
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
environment:
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
- DOCKER_HOST=tcp://docker-in-docker:2375
depends_on:
- workspace
networks:
- backend
links:
- docker-in-docker
### PHP Worker Container #####################################
php-worker:
build:
context: ./php-worker
args:
- PHP_VERSION=${PHP_VERSION}
- INSTALL_SOAP=${PHP_WORKER_INSTALL_SOAP}
- INSTALL_ZIP_ARCHIVE=${PHP_WORKER_INSTALL_ZIP_ARCHIVE}
- PUID=${PHP_WORKER_PUID}
- PGID=${PHP_WORKER_PGID}
links:
- docker-in-docker
volumes:
- ${APP_CODE_LOCAL_PATH}:${APP_CODE_CONTAINER_PATH}${APP_CODE_CONTAINER_FLAG}
- ./php-worker/supervisord.d:/etc/supervisord.d
depends_on:
- workspace
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
### Laravel Echo Server #######################################
laravel-echo-server:
build:
context: ./laravel-echo-server
volumes:
- ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro
ports:
- "${LARAVEL_ECHO_SERVER_PORT}:6001"
links:
- redis
networks:
- frontend
- backend
### Nginx Server Container ##################################
nginx:
build:
context: ./nginx
args:
- PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
- CHANGE_SOURCE=${CHANGE_SOURCE}
volumes:
- ${APP_CODE_LOCAL_PATH}:${APP_CODE_CONTAINER_PATH}${APP_CODE_CONTAINER_FLAG}
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
- ${NGINX_CONF}:/etc/nginx/nginx.conf
- ${NGINX_SSL_PATH}:/etc/nginx/ssl
ports:
- "${NGINX_HOST_HTTP_PORT}:80"
- "${NGINX_HOST_HTTPS_PORT}:443"
depends_on:
- php-fpm
links:
- docker-in-docker
networks:
- frontend
- backend
### MySQL Container #########################################
mysql:
build:
context: ./mysql
args:
- MYSQL_VERSION=${MYSQL_VERSION}
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql
- ${MYSQL_CONF}:/etc/mysql/conf.d/my.cnf
ports:
- "${MYSQL_PORT}:3306"
networks:
- backend
### Redis Container #########################################
redis:
build: ./redis
volumes:
- ${DATA_PATH_HOST}/redis:/data
ports:
- "${REDIS_PORT}:6379"
networks:
- backend
### Memcached Container #####################################
memcached:
build: ./memcached
volumes:
- ${DATA_PATH_HOST}/memcached:/var/lib/memcached
ports:
- "${MEMCACHED_HOST_PORT}:11211"
depends_on:
- php-fpm
networks:
- backend
### Elasticsearch Container #######################################
elasticsearch:
build: ./elasticsearch
volumes:
- elasticsearch:/usr/share/elasticsearch/data
environment:
- cluster.name=devdock-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- "${ELASTICSEARCH_HOST_HTTP_PORT}:9200"
- "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300"
depends_on:
- php-fpm
networks:
- frontend
- backend
### MongoDB Container #######################################
mongo:
build: ./mongo
ports:
- "${MONGODB_PORT}:27017"
volumes:
- ${DATA_PATH_HOST}/mongo:/data/db
### Certbot #########################################
certbot:
build:
context: ./certbot
volumes:
- ./data/certbot/certs/:/var/certs
- ./certbot/letsencrypt/:/var/www/letsencrypt
environment:
- CN="fake.domain.com"
- EMAIL="[email protected]"
networks:
- frontend
### Adminer ###########################################
adminer:
build:
context: ./adminer
args:
- INSTALL_MSSQL=${ADM_INSTALL_MSSQL}
ports:
- "${ADM_PORT}:8080"
depends_on:
- php-fpm
networks:
- frontend
- backend