-
-
Notifications
You must be signed in to change notification settings - Fork 130
/
docker-compose.yml
99 lines (94 loc) · 2.98 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
services:
# Main application database.
app_db:
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD:-password}
MYSQL_DATABASE: ${DB_NAME:-wordpress}
MYSQL_USER: ${DB_USER:-wordpress}
MYSQL_PASSWORD: ${DB_PASSWORD:-password}
networks:
development:
# Capture and display all email sent by WordPress.
mailhog:
image: mailhog/mailhog
ports:
- "1025:1025"
- "8025:8025"
networks:
development:
# Main application service
testable_app:
image: woographql/wordpress-dev:${WP_VERSION:-latest}
depends_on:
- app_db
- mailhog
build:
context: .
args:
PHP_VERSION: ${PHP_VERSION:-8.0}
volumes:
- .:/var/www/html/wp-content/plugins/wp-graphql-woocommerce
- ./codeception.dist.yml:/var/www/html/wp-content/plugins/wp-graphql-woocommerce/codeception.yml
- ./local/public:/var/www/html # WP core files.
- ./local/.htaccess:/var/www/html/.htaccess
- ./.log/testable_app:/var/log/apache2
env_file: .env.testing
environment:
APACHE_RUN_USER: "#1000" # Ensure Apache can write to the filesystem.
DOCKER_GATEWAY_HOST: "172.17.0.1"
XDEBUG_CONFIG: remote_host=${DOCKER_GATEWAY_HOST:-host.docker.internal} idekey=vscode
networks:
development:
ports:
- "9001:9001"
# Main application database clone for testing inside the main application service.
testing_db:
image: mysql:5.7
volumes:
- ./local/db:/docker-entrypoint-initdb.d
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD:-password}
MYSQL_DATABASE: ${DB_NAME:-wordpress}
MYSQL_USER: ${DB_USER:-wordpress}
MYSQL_PASSWORD: ${DB_PASSWORD:-password}
networks:
development:
testing:
aliases:
- app_db
# Standalone testing application service (for inside of CI).
run_tests:
image: woographql/wordpress-ci:${WP_VERSION:-latest}
depends_on:
- testing_db
build:
context: .
args:
PHP_VERSION: ${PHP_VERSION:-8.3}
volumes:
- .:/var/www/html/wp-content/plugins/wp-graphql-woocommerce
- ./codeception.dist.yml:/var/www/html/wp-content/plugins/wp-graphql-woocommerce/codeception.yml
- ./local/public:/var/www/html # WP core files.
- ./local/.htaccess:/var/www/html/.htaccess
- ./.log/run_tests:/var/log/apache2
env_file: .env.testing
environment:
RUNNING_TEST_STANDALONE: 1
GRAPHQL_DEBUG: 1
WPGRAPHQL_WOOCOMMERCE_AUTOLOAD: 1
APACHE_RUN_USER: "#1000" # Ensure Apache can write to the filesystem.
WORDPRESS_DOMAIN: localhost
WP_SITEURL: http://localhost
WP_HOME: http://localhost
HPOS: ${HPOS:-}
command: ./setup-database.sh testing codecept run ${FILTER:-}
networks:
testing:
aliases:
- run_tests
networks:
development:
testing: