-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (42 loc) · 1.31 KB
/
docker-compose.yml
File metadata and controls
46 lines (42 loc) · 1.31 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
---
# ============================================================
# docker-compose.yml – WordPress dockerisé
# Les valeurs sensibles sont dans le fichier .env (non commité)
# Voir .env.example pour la liste des variables requises
# ============================================================
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
- ./sample-data/wordpress.sql:/docker-entrypoint-initdb.d/wordpress.sql
restart: always
environment:
MYSQL_USER: ${MYSQL_USER}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
wordpress:
image: conetix/wordpress-with-wp-cli
volumes:
- ~/wordpress_data:/var/www/html
depends_on:
- db
ports:
- "${WORDPRESS_PORT:-8004}:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: ${MYSQL_USER}
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
command: >
bash -c "
docker-entrypoint.sh apache2-foreground &
sleep 10 &&
IP=$$(curl -s ifconfig.me) &&
wp option update siteurl http://$$IP:${WORDPRESS_PORT:-8004} --allow-root &&
wp option update home http://$$IP:${WORDPRESS_PORT:-8004} --allow-root &&
wait
"
volumes:
db_data: