1
- # https://github.com/docker/compose/issues/4513#issuecomment-281478365
2
- # >> Are we just expected to stay on [Docker Compose file format version 2] if
3
- # >> we want to use docker-compose and not swarm mode?
4
- # >
5
- # > Yes.
6
- #
7
- # https://docs.docker.com/compose/compose-file/compose-file-v2/
8
1
version : ' 2.4'
9
2
10
3
services :
11
4
12
- index-composer :
5
+ index-wordpress :
13
6
command : ' true'
14
- container_name : index-composer
7
+ container_name : index-wordpress
15
8
depends_on :
16
9
- index-wpdb
17
- - index-web
18
10
# https://hub.docker.com/_/composer
19
- image : composer
20
- user : xfs
21
- volumes :
22
- - ./config/composer/composer.json:/var/www/html/composer.json
23
- - ./config/composer/composer.lock:/var/www/html/composer.lock
24
- - index-wp-data:/var/www/html
11
+ image : my-wordpress-site
25
12
working_dir : /var/www/html/
26
-
27
- index-phpmyadmin :
28
- container_name : index-phpmyadmin
29
- depends_on :
30
- - index-wpdb
13
+ networks :
14
+ - index-backend
31
15
environment :
32
16
MYSQL_ROOT_PASSWORD : root
33
17
PMA_HOST : index-wpdb
34
18
PMA_PORT : 3306
35
- # https://hub.docker.com/_/phpmyadmin
36
- image : phpmyadmin
37
- networks :
38
- - index-backend
39
- ports :
40
- - ' 8003:80'
41
- volumes :
42
- # Apache2 web server configuration
43
- - ./config/phpmyadmin-sites-available:/etc/apache2/sites-available:ro
44
-
45
- index-web :
46
- container_name : index-web
47
- depends_on :
48
- - index-wpdb
49
- environment :
50
19
WORDPRESS_CONFIG_EXTRA : |
51
20
# Use dispatch port by default
52
21
if ('${CODESPACE_NAME:-}') {
53
22
define('WP_HOME', 'https://${CODESPACE_NAME:-}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-}');
54
- define('WP_SITEURL', 'https://${CODESPACE_NAME:-}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-}');
55
23
} else {
56
24
define('WP_HOME', 'http://localhost:8080');
57
25
define('WP_SITEURL', 'http://localhost:8080');
@@ -61,12 +29,6 @@ services:
61
29
WORDPRESS_DB_USER : root
62
30
WORDPRESS_DB_name : wordpress
63
31
WORDPRESS_USER : root
64
- # https://hub.docker.com/_/wordpress
65
- # https://github.com/docker-library/repo-info/blob/master/repos/wordpress/remote/latest.md
66
- # https://github.com/docker-library/repo-info/blob/master/repos/wordpress/local/latest.md
67
- image : wordpress:${WP_VERSION:?err}
68
- networks :
69
- - index-backend
70
32
ports :
71
33
- ' 8080:80'
72
34
restart : on-failure
@@ -94,31 +56,6 @@ services:
94
56
# Migration cache
95
57
- ./cache:/var/www/html/cache:ro
96
58
97
- index-wpcli :
98
- # continue running until shutdown (this allows docker compose exec which is
99
- # much faster than docker compose run)
100
- # Thank you: https://serverfault.com/a/1084975
101
- command : sh -c 'trap "exit" TERM; while true; do sleep 1; done'
102
- container_name : index-wpcli
103
- depends_on :
104
- - index-wpdb
105
- - index-web
106
- environment :
107
- WORDPRESS_DB_HOST : index-wpdb:3306
108
- WORDPRESS_DB_NAME : wordpress
109
- WORDPRESS_DB_PASSWORD : root
110
- WORDPRESS_DB_USER : root
111
- WORDPRESS_USER : root
112
- # https://hub.docker.com/_/wordpress
113
- image : wordpress:cli
114
- networks :
115
- - index-backend
116
- user : xfs
117
- volumes :
118
- # WordPress
119
- - index-wp-data:/var/www/html
120
- # Migration cache
121
- - ./cache:/var/www/html/cache:ro
122
59
123
60
index-wpdb :
124
61
container_name : index-wpdb
@@ -143,3 +80,4 @@ volumes:
143
80
networks :
144
81
index-backend :
145
82
name : index-backend
83
+
0 commit comments