-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (55 loc) · 1.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
60 lines (55 loc) · 1.57 KB
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
x-common-variables: &common-variables
WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
services:
wordpress:
image: wordpress:6.6.2-php8.3-apache
depends_on:
- db
restart: always
ports:
- 8080:80
environment: *common-variables
volumes:
- wordpress_data:/var/www/html
# init container to configure WordPress
# config data for `core install` is in wp-cli.yml
wpcli:
image: wordpress:cli-2.11.0-php8.3
depends_on:
wordpress:
condition: service_started
db:
condition: service_healthy
environment:
<<: *common-variables
WP_CLI_CONFIG_PATH: /tmp/wp-cli.yml
restart: "no"
entrypoint: [ "/tmp/wp-setup.sh" ]
volumes:
- wordpress_data:/var/www/html
- ./wp-cli.yml:/tmp/wp-cli.yml
- ./wp-setup.sh:/tmp/wp-setup.sh
user: 33:33 # match the id of the www-data user in the wordpress container
db:
image: mariadb:11.4.3-noble
restart: always
environment:
MARIADB_DATABASE: ${WORDPRESS_DB_NAME}
MARIADB_USER: ${WORDPRESS_DB_USER}
MARIADB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
MARIADB_RANDOM_ROOT_PASSWORD: '1'
healthcheck:
# see https://mariadb.com/kb/en/using-healthcheck-sh/
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 1s
interval: 2s
timeout: 2s
retries: 3
volumes:
- db:/var/lib/MARIADB
volumes:
wordpress_data:
db: