-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
43 lines (40 loc) · 1.13 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
version: '3.8'
services:
wordpress:
build:
context: .
dockerfile: Dockerfile
container_name: wordpress
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
- wordpress_data:/var/www/html
- ./plugins:/var/www/html/wp-content/plugins
- ./example-data:/tmp/example-data
depends_on:
- db
command: >
sh -c "
sleep 20 &&
wp core install --url=localhost:8080 --title='Example Site' --admin_user=admin --admin_password=admin --admin_email=admin@example.com &&
wp plugin install wordpress-importer --activate &&
wp import /tmp/example-data/theme-unittestdata.xml --authors=create &&
docker-entrypoint.sh apache2-foreground
"
db:
image: mysql:5.7
container_name: wordpress_db
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_ROOT_PASSWORD: rootpassword
volumes:
- ./db_data:/var/lib/mysql
volumes:
wordpress_data: