-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (82 loc) · 2.79 KB
/
docker-compose.yml
File metadata and controls
89 lines (82 loc) · 2.79 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
services:
mysql:
image: mariadb:11.4.2
volumes:
- db_data:/var/lib/mysql
ports:
- "3306:3306"
restart: always
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
phpmyadmin:
image: phpmyadmin:5.2.1
ports:
- "8080:80"
depends_on:
- mysql
environment:
PMA_HOST: mysql
PMA_USER: root
PMA_PASSWORD: password
# Generate a locally-trusted TLS cert for the HTTPS Apache vhost. Runs
# once at `npm start`, writes cert.pem + key.pem into ./local/certs/, and
# exits. Skips work if the files already exist. Pattern adopted from
# https://github.com/xwp/vip-site-template/blob/main/docker-compose.yml.
# The image is pre-built and published by .github/workflows/docker-images.yml
# so CI and contributors don't rebuild it on every fresh environment.
# See local/docker/mkcert/Dockerfile and docker-compose.build.yml.
mkcert:
image: ghcr.io/xwp/stream-mkcert:${MKCERT_IMAGE_VERSION:-latest}
build:
context: ./local/docker/mkcert
volumes:
- ./local/certs:/root/.local/share/mkcert
command: |
sh -c 'test -f cert.pem && test -f key.pem || mkcert \
-cert-file cert.pem -key-file key.pem \
"${DEV_URL:-stream.wpenv.net}" "*.${DEV_URL:-stream.wpenv.net}" \
localhost 127.0.0.1'
wordpress:
image: ghcr.io/xwp/stream-wordpress:${WORDPRESS_IMAGE_VERSION:-latest}
build:
context: ./local/docker/wordpress
depends_on:
- mysql
- db_phpunit
- mkcert
ports:
- "80:80"
- "443:443"
volumes:
- .:/var/www/html/wp-content/plugins/stream-src # Working directory.
- ./build:/var/www/html/wp-content/plugins/stream # Built version for testing.
- ./local/public:/var/www/html # WP core files.
- ./local/scripts:/var/local/scripts # Let us access the scripts in the container.
- ./local/certs:/etc/ssl/certs/stream-local:ro # mkcert TLS cert for the HTTPS Apache vhost; generated by the `mkcert` service.
restart: always
extra_hosts:
- host.docker.internal:host-gateway
environment:
APACHE_RUN_USER: "#1000" # Ensure Apache can write to the filesystem.
WP_TESTS_DIR: /var/www/html/wp-content/plugins/stream-src/vendor/wp-phpunit/wp-phpunit
WP_PHPUNIT__TESTS_CONFIG: /var/www/html/wp-tests-config.php
SMTPSERVER: mailhog
EMAIL: local@${DEV_URL:-stream.wpenv.net}
db_phpunit:
image: mariadb:11.4.2
restart: always
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "wordpress_test"
MYSQL_ROOT_PASSWORD: ""
# Capture and display all email sent by WordPress.
mailhog:
image: mailhog/mailhog
ports:
- "8025:8025"
volumes:
db_data: {}
wp_data: {}