-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
68 lines (64 loc) · 2.19 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
version: '3.3'
services:
db:
container_name: 'local-wp-db'
image: 'mysql:5.7'
volumes:
- db_data:/var/lib/mysql
ports:
- '18766:3306'
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress_db
MYSQL_USER: wordpress_user
MYSQL_PASSWORD: wordpress_password
wordpress:
container_name: 'local-wp'
depends_on:
- db
image: 'wordpress:latest'
# image: 'wordpress:beta-6.3-RC2-php8.0'
ports:
- '8000:80'
environment:
WORDPRESS_DB_HOST: 'db:3306'
WORDPRESS_DB_USER: wordpress_user
WORDPRESS_DB_PASSWORD: wordpress_password
WORDPRESS_DB_NAME: wordpress_db
volumes:
- "./wp_data:/var/www/html"
- "./themes:/var/www/html/wp-content/themes"
- "./incompatibility-status/trunk:/var/www/html/wp-content/plugins/incompatibility-status"
wordpress-cli:
container_name: 'local-wp-cli'
depends_on:
- db
- wordpress
image: wordpress:cli
# Run wordpress-cli with the same user-id as wordpress
# to avoid general permission problems:
user: "33:33"
environment:
WORDPRESS_DB_HOST: 'db:3306'
WORDPRESS_DB_USER: wordpress_user
WORDPRESS_DB_PASSWORD: wordpress_password
WORDPRESS_DB_NAME: wordpress_db
# fix default cache dir went to inaccessible directory:
WP_CLI_CACHE_DIR: '/var/www/html/.wp-cli/cache'
# Some "sleep" (waiting) is required so that the command is run after
# mysql is initialized. Depending on your machine this might take
# longer, then the sleep time has to be raised for it to work.
command: >
/bin/sh -c '
sleep 10;
wp core install --path="/var/www/html" --url="http://localhost:8000" --title="Local Wordpress By Docker" --admin_user=admin --admin_password=secret --admin_email=test@example.com;
wp theme install --activate twentytwentytwo;
mkdir -p /var/www/html/wp-content/plugins/gutenberg-incompatibility-status;
'
volumes:
- "./wp_data:/var/www/html"
- "./themes:/var/www/html/wp-content/themes"
- "./incompatibility-status/trunk:/var/www/html/wp-content/plugins/incompatibility-status"
volumes:
db_data:
wp_data: