forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
120 lines (92 loc) · 3.11 KB
/
docker-compose.yml
File metadata and controls
120 lines (92 loc) · 3.11 KB
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
version: '3.7'
services:
##
# The web server container.
##
wordpress-develop:
image: nginx:alpine
platform: linux/arm64
networks:
- wpdevnet
environment:
LOCAL_DIR: ${LOCAL_DIR-src}
LOCAL_PORT: ${LOCAL_PORT-8080}
# Replace with your own server name(s).
SERVER_NAMES: ${SERVER_NAMES-wplocal.dev}
ports:
- ${LOCAL_PORT}:80
- 443:443
volumes:
- ./:/var/www
# Server config template.
- ./tools/local-env/default.conf/default.template:/etc/nginx/conf.d/default.template
# Replace these, using mkcert to generate your own public and private keys.
- ./tools/local-env/devunstuck-key.pem:/root/devunstuck-key.pem
- ./tools/local-env/devunstuck.pub:/root/devunstuck.pub
# Load our config file, substituting environment variables into the config.
command: /bin/sh -c "envsubst '$$LOCAL_DIR$$SERVER_NAMES' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
depends_on:
- php
##
# The PHP container.
##
php:
# build this custom image from dir with `docker build -t php:custom .`
image: devunstuck/php-xdebug-wpcli-arm:8.0-fpm
platform: linux/arm64
networks:
- wpdevnet
environment:
- LOCAL_PHP_XDEBUG=${LOCAL_PHP_XDEBUG-false}
- XDEBUG_MODE=${LOCAL_PHP_XDEBUG_MODE-debug}
- LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-true}
- PHP_FPM_UID=${PHP_FPM_UID-1000}
- PHP_FPM_GID=${PHP_FPM_GID-1000}
- GITHUB_REF=${GITHUB_REF-false}
- GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME-false}
volumes:
- ./tools/local-env/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
- ./:/var/www/
# Copy or delete the Memcached dropin plugin file as appropriate.
command: |
/bin/sh -c "if [ $LOCAL_PHP_MEMCACHED = true ]; then cp -n /var/www/tests/phpunit/includes/object-cache.php /var/www/src/wp-content/object-cache.php; else rm -f /var/www/src/wp-content/object-cache.php; fi && exec php-fpm"
depends_on:
- mysql
# The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
init: true
extra_hosts:
- localhost:host-gateway
##
# The MySQL container.
##
mysql:
image: mysql:latest
platform: linux/arm64
networks:
- wpdevnet
ports:
- '33060:3306'
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- ./tools/local-env/mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
- mysql:/var/lib/mysql
# For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
command: --default-authentication-plugin=mysql_native_password
#
# The Memcached container.
#
memcached:
image: memcached
platform: linux/arm64
networks:
- wpdevnet
ports:
- 11211:11211
volumes:
# So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
mysql: {}
networks:
# Creating our own network allows us to connect between containers using their service name.
wpdevnet:
driver: bridge