-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
126 lines (120 loc) · 3.51 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: "2.3"
volumes:
wordpress_data:
wordpress_db:
services:
sut:
build:
context: ./
dockerfile: Dockerfile.test
depends_on:
wordpress:
condition: service_started
wordpressdb:
condition: service_healthy
volumes:
# To persist WP
- wordpress_data:/var/www/html
# To mount local plugin into WP
- .:/var/www/html/wp-content/plugins/${WP_PLUGIN}
# To persist WP tests lib
#- /srv/wordpress/tests-lib:/tmp/wordpress-tests-lib
environment:
- WAIT_FOR_DB=true
- PROJECT_DIR=/var/www/html/wp-content/plugins/${WP_PLUGIN}
# WordPress tests config
- DB_NAME=${WORDPRESS_DB_NAME}
- DB_USER=${WORDPRESS_DB_USER}
- DB_PASS=${WORDPRESS_DB_PASSWORD}
- DB_HOST=wordpressdb:3306
- WP_VERSION=${WP_VERSION}
- TMPDIR=/tmp
- WP_TESTS_DIR=/tmp/wordpress-tests-lib
- WP_CORE_DIR=/var/www/html
- WP_PLUGIN=${WP_PLUGIN}
wordpress:
# https://hub.docker.com/repository/docker/monogramm/docker-wordpress
image: monogramm/docker-wordpress:${WP_VERSION}-apache
container_name: wordpress
#restart: always
hostname: localhost
depends_on:
wordpressdb:
condition: service_healthy
links:
- wordpressdb
expose:
- '80'
ports:
- "8080:80"
volumes:
# To persist WP
- wordpress_data:/var/www/html
# To mount local plugin into WP
- .:/var/www/html/wp-content/plugins/${WP_PLUGIN}
environment:
- WP_DEBUG=true
# Site Config
- WORDPRESS_USERNAME=${WORDPRESS_ADMIN_LOGIN}
- WORDPRESS_PASSWORD=${WORDPRESS_ADMIN_PWD}
- WORDPRESS_EMAIL=admin@${DOMAIN}
- WORDPRESS_FIRST_NAME=Admin
- WORDPRESS_LAST_NAME=WordPress
- WORDPRESS_BLOG_NAME=${WORDPRESS_BLOG_NAME}
# DB Config
- WORDPRESS_DB_HOST=wordpressdb:3306
- WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME}
- WORDPRESS_DB_USER=${WORDPRESS_DB_USER}
- WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD}
- WORDPRESS_TABLE_PREFIX=${WORDPRESS_TBL_PREFIX}
# SMTP Config
- SMTP_HOST=wordpressmailer
- SMTP_PORT=1025
- SMTP_DOMAIN=localhost
- SMTP_USER=${WORDPRESS_SMTP_USER}
- SMTP_PASSWORD=${WORDPRESS_SMTP_PWD}
- SMTP_PROTOCOL=
wordpressdb:
image: mariadb:latest
container_name: wordpressdb
#restart: always
command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"--password=${WORDPRESS_DB_ROOT_PWD}",
]
timeout: 10s
retries: 5
expose:
- "3306"
ports:
- "33306:3306"
volumes:
- wordpress_db:/var/lib/mysql
# If you want, you can sync time & timezone with host
#- /etc/localtime:/etc/localtime:ro
#- /etc/timezone:/etc/timezone:ro
environment:
- MYSQL_ROOT_PASSWORD=${WORDPRESS_DB_ROOT_PWD}
- MYSQL_DATABASE=${WORDPRESS_DB_NAME}
- MYSQL_USER=${WORDPRESS_DB_USER}
- MYSQL_PASSWORD=${WORDPRESS_DB_PASSWORD}
wordpressmailer:
image: sj26/mailcatcher:latest
hostname: wordpressmailer
container_name: wordpressmailer
restart: always
expose:
- '1025'
ports:
- "1080:1080"
# If you want, you can sync time & timezone with host
#volumes:
# - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro