-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdocker-compose.yml
310 lines (292 loc) · 8.9 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
---
version: "3.6"
services:
# NginX reverse proxy:
nginx:
container_name: "nginx-router-wordpress"
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
healthcheck:
test: ["CMD-SHELL", "nginx -t 2>&1 | grep 'test is successful' || exit 1"]
interval: 15s
timeout: 10s
retries: 7
start_period: 10s
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- "./config/yoastnginx.conf:/etc/nginx/conf.d/yoastnginx.conf"
- "./config/certs:/etc/nginx/certs"
networks:
wordpress_net:
aliases:
- ${BASIC_HOST:-basic.wordpress.test}
- ${WOOCOMMERCE_HOST:-woocommerce.wordpress.test}
- ${MULTISITE_HOST:-multisite.wordpress.test}
- ${MULTISITEDOMAIN_HOST:-multisite.wordpress.test}
- test.${MULTISITEDOMAIN_HOST:-multisite.wordpress.test}
- translate.${MULTISITEDOMAIN_HOST:-multisite.wordpress.test}
- ${STANDALONE_HOST:-standalone.wordpress.test}
- ${NIGHTLY_HOST:-nightly.wordpress.test}
- mailhog.local
labels:
- dev.orbstack.domains=mailhog.local
# Mailhog:
mailhog:
container_name: "mailhog-wordpress"
image: mailhog/mailhog
platform: linux/amd64
# logging:
# driver: none # disable saving logs to prevent bloat
ports:
- 127.0.0.1:8025:8025 # web ui
networks:
- wordpress_net
environment:
VIRTUAL_HOST: mailhog.local
VIRTUAL_PORT: 8025
# base database:
base-database:
image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-5.7.25}
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
healthcheck:
# needs to work for both MySQL and mariaDB
test:
[
"CMD-SHELL",
"mysqladmin -u $$MYSQL_USER -p$$MYSQL_PASSWORD ping -P 3306 -h $$(hostname) | grep -q 'mysqld is alive'"
]
interval: 1s
timeout: 10s
retries: 1200
profiles: [ "base_service" ]
networks:
- wordpress_net
# base wordpress
base-wordpress:
depends_on:
nginx:
condition: service_started
mailhog:
condition: service_started
build:
context: .
dockerfile: ./containers/wordpress/Dockerfile
args:
- GID=${GID:-1000}
- UID=${LOCAL_UID:-1000}
restart: always
expose:
- 80
environment:
ADMIN_USERNAME: admin
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: admin
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX}
volumes:
- "./wordpress:/var/www/html"
- "./plugins:/var/www/html/wp-content/plugins"
- "./xdebug:/var/xdebug"
- "./config/php.ini:/usr/local/etc/php/conf.d/custom.ini"
labels:
- com.yoast.plugin-development-docker.mainwpinstance
healthcheck:
test: [ "CMD-SHELL", "[ -f /tmp/done ]" ]
interval: 1s
timeout: 5s
retries: 1200
profiles: [ "base_service" ]
networks:
- wordpress_net
# Basic WordPress:
basic-database:
extends:
service: base-database
container_name: "wordpress-basic-database"
ports:
- "1987:3306"
volumes:
- "basic-database-data:/var/lib/mysql"
profiles: [ "basic-wordpress" ]
basic-wordpress:
extends:
service: base-wordpress
container_name: "basic-wordpress"
depends_on:
basic-database:
condition: service_healthy
build:
args:
- SEED_FILE=basic-wordpress-seed.sh
environment:
SITE_TITLE: Basic
SITE_URL: ${BASIC_HOST:-basic.wordpress.test}
VIRTUAL_HOST: ${BASIC_HOST:-basic.wordpress.test}
WORDPRESS_DB_HOST: wordpress-basic-database
volumes:
- "./config/basic/wp-config.php:/var/www/html/wp-config.php"
profiles: [ "basic-wordpress" ]
# WooCommerce WordPress:
woocommerce-database:
extends:
service: base-database
container_name: "wordpress-woocommerce-database"
ports:
- "1988:3306"
volumes:
- "woocommerce-database-data:/var/lib/mysql"
profiles: [ "woocommerce-wordpress" ]
woocommerce-wordpress:
extends:
service: base-wordpress
container_name: "woocommerce-wordpress"
depends_on:
woocommerce-database:
condition: service_healthy
build:
args:
- SEED_FILE=woocommerce-wordpress-seed.sh
environment:
SITE_TITLE: WooCommerce
SITE_URL: ${WOOCOMMERCE_HOST:-woocommerce.wordpress.test}
VIRTUAL_HOST: ${WOOCOMMERCE_HOST:-woocommerce.wordpress.test}
WORDPRESS_DB_HOST: wordpress-woocommerce-database
volumes:
- "./config/woocommerce/wp-config.php:/var/www/html/wp-config.php"
profiles: [ "woocommerce-wordpress" ]
# Multisite WordPress:
multisite-database:
extends:
service: base-database
container_name: "wordpress-multisite-database"
ports:
- "1989:3306"
volumes:
- "multisite-database-data:/var/lib/mysql"
profiles: [ "multisite-wordpress" ]
multisite-wordpress:
extends:
service: base-wordpress
container_name: "multisite-wordpress"
depends_on:
multisite-database:
condition: service_healthy
build:
args:
- SEED_FILE=multisite-wordpress-seed.sh
environment:
SITE_TITLE: multisite
SITE_URL: ${MULTISITE_HOST:-multisite.wordpress.test}
VIRTUAL_HOST: ${MULTISITE_HOST:-multisite.wordpress.test}
WORDPRESS_DB_HOST: wordpress-multisite-database
volumes:
- "./config/multisite.htaccess:/var/www/html/.htaccess"
- "./config/multisite/wp-config.php:/var/www/html/wp-config.php"
profiles: [ "multisite-wordpress" ]
# Multisite WordPress using Subdomains:
multisitedomain-database:
extends:
service: base-database
container_name: "wordpress-multisitedomain-database"
ports:
- "1991:3306"
volumes:
- "multisitedomain-database-data:/var/lib/mysql"
profiles: [ "multisitedomain-wordpress" ]
multisitedomain-wordpress:
extends:
service: base-wordpress
container_name: "multisitedomain-wordpress"
depends_on:
multisitedomain-database:
condition: service_healthy
build:
args:
- SEED_FILE=multisitedomain-wordpress-seed.sh
environment:
SITE_TITLE: multisitedomain
SITE_URL: ${MULTISITEDOMAIN_HOST:-multisite.wordpress.test}
VIRTUAL_HOST: ${MULTISITEDOMAIN_HOST:-multisite.wordpress.test},test.${MULTISITEDOMAIN_HOST:-multisite.wordpress.test},translate.${MULTISITEDOMAIN_HOST:-multisite.wordpress.test}
WORDPRESS_DB_HOST: wordpress-multisitedomain-database
volumes:
- "./config/multisite.htaccess:/var/www/html/.htaccess"
- "./config/multisitedomain/wp-config.php:/var/www/html/wp-config.php"
profiles: [ "multisitedomain-wordpress" ]
# Standalone WordPress:
standalone-database:
extends:
service: base-database
container_name: "wordpress-standalone-database"
ports:
- "1990:3306"
volumes:
- "standalone-database-data:/var/lib/mysql"
profiles: [ "standalone-wordpress" ]
standalone-wordpress:
extends:
service: base-wordpress
container_name: "standalone-wordpress"
depends_on:
standalone-database:
condition: service_healthy
build:
args:
- SEED_FILE=standalone-wordpress-seed.sh
environment:
SITE_TITLE: Standalone
SITE_URL: ${STANDALONE_HOST:-standalone.wordpress.test}
VIRTUAL_HOST: ${STANDALONE_HOST:-standalone.wordpress.test}
WORDPRESS_DB_HOST: wordpress-standalone-database
volumes:
- "./sa-plugins:/var/www/html/wp-content/plugins"
- "./config/standalone/wp-config.php:/var/www/html/wp-config.php"
profiles: [ "standalone-wordpress" ]
# Nightly WordPress:
nightly-database:
extends:
service: base-database
container_name: "wordpress-nightly-database"
ports:
- "1992:3306"
volumes:
- "nightly-database-data:/var/lib/mysql"
profiles: [ "nightly-wordpress" ]
nightly-wordpress:
extends:
service: base-wordpress
container_name: "nightly-wordpress"
depends_on:
nightly-database:
condition: service_healthy
build:
args:
- SEED_FILE=nightly-wordpress-seed.sh
environment:
SITE_TITLE: nightly
SITE_URL: ${NIGHTLY_HOST:-nightly.wordpress.test}
VIRTUAL_HOST: ${NIGHTLY_HOST:-nightly.wordpress.test}
WORDPRESS_DB_HOST: wordpress-nightly-database
volumes:
- "./wordpress-nightly:/var/www/html"
- "./config/nightly/wp-config.php:/var/www/html/wp-config.php"
profiles: [ "nightly-wordpress" ]
volumes:
basic-database-data:
woocommerce-database-data:
multisite-database-data:
multisitedomain-database-data:
standalone-database-data:
nightly-database-data:
networks:
wordpress_net:
driver: bridge
name: yoast-docker