-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
89 lines (83 loc) · 2.29 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
version: "3.9"
services:
# WordPress site
## PHP + Core
wordpress:
depends_on:
wpdb:
condition: service_healthy
image: wordpress:latest
volumes:
- wordpress_data:/var/www/html
- ./:/var/www/html/wp-content/plugins/everything-all-of-the-time
ports:
- "6060:80"
restart: always
environment:
WORDPRESS_DB_HOST: wpdb:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
## Database for WordPress site
wpdb:
image: mariadb:10.5.8
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
healthcheck:
test: "/usr/bin/mysql --user=wordpress --password=wordpress --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
## WPCLI Runner
wpcli:
image: wordpress:cli
depends_on:
wpdb:
condition: service_healthy
volumes:
- wordpress_data:/var/www/html
- ./:/var/www/html/wp-content/plugins/everything-all-of-the-time
- ./db:/var/www/html/db
environment:
WORDPRESS_DB_HOST: wpdb:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
ABSPATH: /usr/src/wordpress/
# Integration Testing - Tests that run in phpunit with WordPress + MySQL
## Runner for phpunit
phpunit:
## set PHP_IMAGE_TAG and/or WORDPRESS_VERSION in .env to set versions
image: josh412/wp-phpunit:php-${PHP_IMAGE_TAG-7.4}-wp-${WORDPRESS_VERSION-latest}
command:
- bash
## Wait to start until the database server for testing is ready.
depends_on:
- testwpdb
environment:
DATABASE_PASSWORD: examplepass
DATABASE_HOST: testwpdb
stdin_open: true
tty: true
volumes:
## Map this directory into the test plugin directory
- ./:/plugin
#Database for tests
testwpdb:
environment:
MYSQL_ROOT_PASSWORD: examplepass
image: mariadb:10.5.8
healthcheck:
test: "/usr/bin/mysql --user=wordpress --password=wordpress --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
volumes:
db_data: {}
wordpress_data: {}