-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
87 lines (82 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
services:
# Modern development environment
wordpress:
build:
context: .
dockerfile: docker/Dockerfile.wordpress
ports:
- "8000:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DEBUG: 1
volumes:
- wordpress_data:/var/www/html
depends_on:
db:
condition: service_healthy
db:
image: mysql:8.0.32
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
command: >-
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
# Test environment with configurable PHP version
wordpress-test:
build:
context: .
dockerfile: tests/Dockerfile
args:
PHP_VERSION: ${PHP_VERSION:-7.4} # Can be overridden with PHP_VERSION=8.1 docker compose up wordpress-test
environment:
- WP_TESTS_DIR=/tmp/wordpress-tests-lib
- WP_CORE_DIR=/tmp/wordpress
- WP_VERSION=${WP_VERSION:-6.4} # Can be overridden with WP_VERSION=6.3 docker compose up wordpress-test
volumes:
- .:/var/www/html/wp-content/plugins/screenly-cast
depends_on:
db-test:
condition: service_healthy
db-test:
image: mysql:8.0.32
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress_test
command: >-
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
tmpfs:
- /var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
# Linting environment
lint:
build:
context: .
dockerfile: tests/Dockerfile
args:
PHP_VERSION: ${PHP_VERSION:-7.4}
volumes:
- .:/var/www/html/wp-content/plugins/screenly-cast
command: bash -c "composer update && composer run lint"
volumes:
wordpress_data:
db_data: