-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
103 lines (94 loc) · 2.56 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
# https://docs.docker.com/compose/compose-file/compose-file-v2/
version: '2.4'
services:
wordpress:
container_name: vocabtheme-wordpress-web
depends_on:
- database
environment:
WORDPRESS_CONFIG_EXTRA: |
# Use dispatch port by default
if ('${CODESPACE_NAME:-}') {
define('WP_HOME', 'https://${CODESPACE_NAME:-}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-}');
define('WP_SITEURL', 'https://${CODESPACE_NAME:-}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-}');
} else {
define('WP_HOME', 'http://localhost:8080');
define('WP_SITEURL', 'http://localhost:8080');
}
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_PASSWORD: root
WORDPRESS_DB_USER: root
WORDPRESS_DB_name: wordpress
WORDPRESS_USER: root
# https://hub.docker.com/_/wordpress
image: wordpress:${WP_VERSION:?err}
networks:
- backend
ports:
- '8080:80'
restart: always
volumes:
- ./src:/var/www/html/wp-content/${WP_MOD_TYPE:?err}s/${WP_MOD_NAME:?err}
- wp_data:/var/www/html
database:
container_name: vocabtheme-wordpress-db
environment:
MYSQL_DATABASE: wordpress
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: root
# https://hub.docker.com/_/mariadb
image: mariadb
networks:
- backend
restart: always
volumes:
- db_data:/var/lib/mysql
phpmyadmin:
container_name: vocabtheme-phpmyadmin
environment:
MYSQL_ROOT_PASSWORD: root
PMA_HOST: database
PMA_PORT: 3306
# https://hub.docker.com/_/phpmyadmin
image: phpmyadmin/phpmyadmin
networks:
- backend
ports:
- '8003:80'
composer:
command: 'true'
container_name: vocabtheme-composer
depends_on:
- database
- wordpress
# https://hub.docker.com/_/composer
image: composer
user: xfs
volumes:
- ./docker/configs/composer.json:/var/www/html/composer.json
- ./docker/configs/composer.lock:/var/www/html/composer.lock
- wp_data:/var/www/html
working_dir: /var/www/html/
wordpress-cli:
container_name: vocabtheme-wpcli
depends_on:
- database
- wordpress
environment:
WORDPRESS_DB_HOST: database:3306
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_PASSWORD: root
WORDPRESS_DB_USER: root
WORDPRESS_USER: root
# https://hub.docker.com/_/wordpress
image: wordpress:cli
networks:
- backend
user: xfs
volumes:
- wp_data:/var/www/html
volumes:
db_data:
wp_data:
networks:
backend: