-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
199 lines (188 loc) · 4.67 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
version: '3.7'
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
adminer:
driver: local
mysql:
driver: local
redis:
driver: local
services:
# Adminer
## Database management in a single PHP file.
adminer:
container_name: ADMINER
image: adminer
restart: always
ports:
- 8080:8080
depends_on:
- php-fpm
networks:
- frontend
- backend
# MySQL
## MySQL is a widely used, open source relational database management system
## (RDBMS).
mysql:
container_name: ${DB_HOST}
build:
context: ./.docker/mysql
args:
- MYSQL_VERSION=${MYSQL_VERSION}
environment:
- MYSQL_DATABASE=${DB_DATABASE}
- MYSQL_USER=${DB_USERNAME}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=${TIMEZONE}
volumes:
- ./.docker/data/mysql:/var/lib/mysql
- ./.docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- '${DB_PORT}:3306'
networks:
- backend
# NGINX
## Nginx is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3,
## and IMAP protocols as well as a load balancer, HTTP cache, and a web
## server.
nginx:
container_name: NGINX
depends_on:
- php-fpm
build:
context: ./.docker/nginx
args:
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
- http_proxy
- https_proxy
- no_proxy
volumes:
- ./:/var/www:cached
- ./.docker/logs/nginx/:/var/log/nginx
- ./.docker/nginx/sites/:/etc/nginx/sites-available
- ./.docker/nginx/ssl/:/etc/nginx/ssl
ports:
- '${NGINX_HTTP_PORT}:80'
- '${NGINX_HTTPS_PORT}:443'
networks:
- frontend
- backend
# PHP-FPM
## A simple and robust FastCGI Process Manager for PHP.
php-fpm:
container_name: PHP-FPM
depends_on:
- workspace
build:
context: ./.docker/php-fpm
args:
- PHP_VERSION=${PHP_VERSION}
- INSTALL_XDEBUG=${INSTALL_XDEBUG}
- http_proxy
- https_proxy
- no_proxy
environment:
- DOCKER_HOST=tcp://docker-in-docker:2375
volumes:
- ./:/var/www:cached
- ./.docker/php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
networks:
- backend
extra_hosts:
- 'dockerhost:${DOCKER_HOST_IP}'
expose:
- '9000'
links:
- docker-in-docker
# PHP-Worker
## A queue worker using supervisord.
php-worker:
container_name: PHP-WORKER
depends_on:
- workspace
build:
context: ./.docker/php-worker
args:
- PHP_VERSION=${PHP_VERSION}
- GID=${WORKER_GID}
- GNAME=${WORKER_GNAME}
- UID=${WORKER_UID}
- UNAME=${WORKER_UNAME}
volumes:
- ./:/var/www:cached
- ./.docker/logs/php-worker/:/var/log/php-worker
- ./.docker/php-worker/supervisord.d:/etc/supervisord.d
networks:
- backend
extra_hosts:
- 'dockerhost:${DOCKER_HOST_IP}'
# Redis
## Redis is an open source key-value store that functions as a data structure
## server.
redis:
container_name: ${REDIS_HOST}
build:
context: ./.docker/redis
args:
- REDIS_VERSION=${REDIS_VERSION}
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- ./.docker/data/redis:/data
ports:
- '${REDIS_PORT}:6379'
networks:
- backend
# Workspace
## Your workspace is where most of your interactions with the server will
## take place. Artisan commands, composer, and npm should be run from within
## this container.
workspace:
container_name: WORKSPACE
build:
context: ./.docker/workspace
args:
- PHP_VERSION=${PHP_VERSION}
- UID=${WORKSPACE_UID}
- UNAME=${WORKSPACE_UNAME}
- GID=${WORKSPACE_GID}
- GNAME=${WORKSPACE_UNAME}
- TZ=${TIMEZONE}
- NODE_VERSION=${NODE_VERSION}
- INSTALL_FFMPEG=${INSTALL_FFMPEG}
- INSTALL_XDEBUG=${INSTALL_XDEBUG}
- http_proxy
- https_proxy
- no_proxy
environment:
- DOCKER_HOST=tcp://docker-in-docker:2375
volumes:
- ./:/var/www:cached
- ./.docker/php-worker/supervisord.d:/etc/supervisord.d
ports:
- '${WORKSPACE_SSH_PORT}:22'
networks:
- frontend
- backend
extra_hosts:
- 'dockerhost:${DOCKER_HOST_IP}'
tty: true
links:
- docker-in-docker
# Docker-in-Docker
## Docker running within the Docker container.
docker-in-docker:
container_name: DOCKER-IN-DOCKER
image: docker:dind
volumes:
- ./:/var/www
expose:
- 2375
networks:
- backend
privileged: true