-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
195 lines (178 loc) · 5.42 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: organic-wp-plugin
x-vars:
db-password: &db-password organicwpplugin
db-user: &db-user root
x-templates:
base-build: &base-build
context: ./docker-context
args:
COMPOSER_AUTH: ${COMPOSER_AUTH}
base-wordpress: &base-wordpress
depends_on:
db:
condition: service_healthy
composer:
condition: service_started
nodejs:
condition: service_started
selenium:
condition: service_started
nginx-proxy:
condition: service_started
networks:
default:
aliases:
# Shared by all WP services. The port distinguishes them.
- wpplugin.lcl.organic.ly
volumes:
- ./src:/var/www/html/wp-content/plugins/wordpress-plugin:ro
- ./docker-context/fixtures/data.yml:/tmp/docker-context/fixtures/data.yml:ro
healthcheck:
test: [ "CMD", "test", "-f", "./wp-config.php" ]
interval: 5s
timeout: 3s
retries: 3
base-environment: &base-environment
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: *db-user
WORDPRESS_DB_PASSWORD: *db-password
ORGANIC_ENVIRONMENT: ${ORGANIC_ENVIRONMENT}
ORGANIC_API_URL: ${ORGANIC_API_URL}
ORGANIC_CDN_URL: ${ORGANIC_CDN_URL}
# This tells our reverse proxy which container services the wpplugin URL.
# Every wp service has the same alias/virtual host setting, but they differ
# in which ports they listen to.
VIRTUAL_HOST: wpplugin.lcl.organic.ly
services:
wp49-php72:
build:
<<: *base-build
target: wp49-php72
args:
- WP49_PHP72_PORT=${WP49_PHP72_PORT}
<<: *base-wordpress
ports:
- ${WP49_PHP72_PORT}:${WP49_PHP72_PORT}
environment:
<<: *base-environment
WORDPRESS_DB_NAME: wp49_php72
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://wpplugin.lcl.organic.ly:8031');
define('WP_SITEURL', 'http://wpplugin.lcl.organic.ly:8031');
wp59-php74:
build:
<<: *base-build
target: wp59-php74
args:
- WP59_PHP74_PORT=${WP59_PHP74_PORT}
<<: *base-wordpress
ports:
- ${WP59_PHP74_PORT}:${WP59_PHP74_PORT}
environment:
<<: *base-environment
WORDPRESS_DB_NAME: wp59_php74
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://wpplugin.lcl.organic.ly:8032');
define('WP_SITEURL', 'http://wpplugin.lcl.organic.ly:8032');
wp61-php74:
build:
<<: *base-build
target: wp61-php74
args:
- WP61_PHP74_PORT=${WP61_PHP74_PORT}
<<: *base-wordpress
ports:
- ${WP61_PHP74_PORT}:${WP61_PHP74_PORT}
environment:
<<: *base-environment
WORDPRESS_DB_NAME: wp61_php74
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://wpplugin.lcl.organic.ly:8033');
define('WP_SITEURL', 'http://wpplugin.lcl.organic.ly:8033');
wp61-php82:
build:
<<: *base-build
target: wp61-php82
args:
- WP61_PHP82_PORT=${WP61_PHP82_PORT}
<<: *base-wordpress
ports:
- ${WP61_PHP82_PORT}:${WP61_PHP82_PORT}
environment:
<<: *base-environment
WORDPRESS_DB_NAME: wp61_php82
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://wpplugin.lcl.organic.ly:8034');
define('WP_SITEURL', 'http://wpplugin.lcl.organic.ly:8034');
db:
image: mysql:8.0.32-oracle
command: --default-authentication-plugin=mysql_native_password
ports:
- 3330:3306
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent" ]
interval: 5s
timeout: 3s
retries: 5
environment:
MYSQL_ROOT_PASSWORD: *db-password
volumes:
- db-data:/var/lib/mysql
composer:
build:
<<: *base-build
target: builder
command: bash -c "sleep infinity"
environment:
COMPOSER_AUTH: ${COMPOSER_AUTH}
WP_HOME: 'http://wpplugin.lcl.organic.ly'
SELENIUM_URL: 'http://selenium:4444/wd/hub'
ORGANIC_TEST_USER_EMAIL: ${ORGANIC_TEST_USER_EMAIL}
ORGANIC_TEST_USER_PASSWORD: ${ORGANIC_TEST_USER_PASSWORD}
volumes:
- ./src:/app
nodejs:
build:
<<: *base-build
target: builder
# on fresh build/start node_modules will be empty until 'npm install'
command: bash -c "until npx nodemon --ignore "*/build/*.js"; do sleep 5; done"
working_dir: /blocks
volumes:
- ./src/blocks:/blocks
- blocks-node-modules:/blocks/node_modules
selenium:
# For ARM64 set `SELENIUM_IMAGE=seleniarm/standalone-chromium:4.0.0-20211213` in your `.env` file
image: ${SELENIUM_IMAGE:-selenium/standalone-chrome:4.8.3}
shm_size: '1gb'
ports:
# Increment default port numbers by 1 to avoid conflict with organic dev.
- 4445:4444
# https://github.com/seleniumhq-community/docker-seleniarm#running-the-arm-container-images
# Visit http://localhost:7901 to see what's happening in the browser
# during selenium tests
#
# !!! VNC password is "secret" !!!
- 5901:5900 # port for external VNC client
- 7901:7900 # noVNC.com UI
nginx-proxy:
image: nginxproxy/nginx-proxy:1642
ports:
- "1080:1080"
- "10443:10443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: unless-stopped
networks:
default:
builder:
build:
<<: *base-build
target: builder
working_dir: /plugin
volumes:
- ./:/plugin
- blocks-node-modules:/plugin/src/blocks/node_modules
volumes:
db-data: {}
blocks-node-modules: {}