-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
165 lines (156 loc) · 6.06 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
version: '3'
services:
db:
image: mariadb:10.11.10@sha256:79cf033abf9089f27dd4c3e831cbef83048a52d6f52783930b647c56224d95c3
container_name: db
restart: unless-stopped
logging:
driver:
${LOCAL_DB_LOG_DRIVER:-local}
environment:
- MYSQL_DATABASE=wordpress
- MYSQL_ROOT_PASSWORD=${WORDPRESS_DB_PASSWORD}
- MYSQL_USER=${WORDPRESS_DB_USER}
- MYSQL_PASSWORD=${WORDPRESS_DB_PASSWORD}
volumes:
- dbdata:/var/lib/mysql
command: '--default-authentication-plugin=mysql_native_password'
networks:
- app-network
ports:
- 3307:3306
cap_add:
- SYS_NICE # CAP_SYS_NICE
apache:
container_name: apache
image: httpd:2.4-alpine@sha256:88c55a4fcc1df6cf9e7b38360fb6a6feb4d5c5cf5a27a9ff38096ae585af707f
logging:
driver: none
ports:
- 80:80
volumes:
- wordpress:/usr/src/wordpress
- ./wordpress/vendor:/usr/src/wordpress/vendor
- ./wordpress/wp-content:/usr/src/wordpress/wp-content
- ./wordpress/wp-config.php:/usr/src/wordpress/wp-config.php
- ./wordpress/.htaccess-multisite:/usr/src/wordpress/.htaccess
- ./wordpress/docker/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf
- ./wordpress/docker/apache/conf.d/php-fpm.conf:/usr/local/apache2/conf.d/php-fpm.conf
- ./wordpress/docker/apache/conf.d/default-site.conf:/usr/local/apache2/conf.d/default-site.conf
- ./assets/en.png:/usr/src/wordpress/wp-content/plugins/sitepress-multilingual-cms/res/flags/en.png
- ./assets/en.svg:/usr/src/wordpress/wp-content/plugins/sitepress-multilingual-cms/res/flags/en.svg
- ./assets/fr.png:/usr/src/wordpress/wp-content/plugins/sitepress-multilingual-cms/res/flags/fr.png
- ./assets/fr.svg:/usr/src/wordpress/wp-content/plugins/sitepress-multilingual-cms/res/flags/fr.svg
networks:
- app-network
wordpress:
depends_on:
- db
build:
dockerfile: local.Dockerfile
context: ./wordpress/docker
container_name: wordpress
restart: always
env_file: .env
volumes:
- wordpress:/usr/src/wordpress
- ./wordpress/vendor:/usr/src/wordpress/vendor
- ./wordpress/wp-content:/usr/src/wordpress/wp-content
- ./wordpress/wp-config.php:/usr/src/wordpress/wp-config.php
- ./wordpress/.htaccess-multisite:/usr/src/wordpress/.htaccess
- ./wordpress/docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- ./wordpress/docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
- ./wordpress/docker/php/conf.d/upload_max_filesize.ini:/usr/local/etc/php/conf.d/upload_max_filesize.ini
- ./wordpress/docker/php/conf.d/memory_limit.ini:/usr/local/etc/php/conf.d/memory_limit.ini
- ./wordpress/docker/php/conf.d/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
- ./wordpress/docker/php/conf.d/max_execution_time.ini:/usr/local/etc/php/conf.d/max_execution_time.ini
- ./wordpress/docker/php/conf.d/expose_php.ini:/usr/local/etc/php/conf.d/expose_php.ini
- ./wordpress/docker/php/conf.d/zz-docker.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
networks:
- app-network
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin@sha256:44328e7738eb732bed34fa2dd10c0e4683cbf0b87c23be2f660ea8ccfc271942
restart: always
logging:
driver:
${LOCAL_PHPMYADMIN_LOG_DRIVER:-local}
ports:
- 8080:80
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: secret
networks:
- app-network
composer:
restart: 'no'
image: composer/composer:latest@sha256:cee72fc7c48eac4daf6edd1f5b44f0f88f4fabc5930ad418b00b3ed43205faa4
env_file: .env
command: >
/bin/bash -c '
composer config -g http-basic.my.yoast.com token ${COMPOSER_YOAST_TOKEN};
composer install;
'
profiles:
- tools
volumes:
- ~/.ssh:/root/.ssh
- ~/.gitconfig:/root/.gitconfig
- ./wordpress:/app
install:
depends_on:
- db
- wordpress
image: wordpress:cli-php8.1@sha256:066ebcfbd9116c2361ac8357b11128c4833074f03f7c00657e85e68f08beea0e
profiles:
- tools
env_file: .env
command: >
/bin/bash -c '
/wait-for-it.sh db:3306;
cd /usr/src/wordpress;
wp core multisite-install --url="localhost" --title="CDS Wordpress Base" --admin_user=${ADMIN_USER} --admin_password=${ADMIN_PASSWORD} --admin_email=${ADMIN_EMAIL};
wp option update permalink_structure "/%postname%/";
wp theme enable cds-default --activate --network;
wp theme disable twentytwentyone --network;
wp plugin activate sitepress-multilingual-cms cds-base two-factor login-lockdown --network;
wp plugin activate s3-uploads wps-hide-login disable-user-login --network;
wp plugin activate wordpress-seo wordpress-seo-premium wpml-string-translation wp-seo-multilingual --network;
wp plugin activate jwt-authentication-for-wp-rest-api --network;
wp plugin activate delete-orphaned-multisite-tables --network;
wp plugin activate gc-lists --network;
'
volumes:
- wordpress:/usr/src/wordpress
- ./wordpress/vendor:/usr/src/wordpress/vendor
- ./wordpress/wp-content:/usr/src/wordpress/wp-content
- ./wordpress/wp-config.php:/usr/src/wordpress/wp-config.php
- ./wait-for-it.sh:/wait-for-it.sh
networks:
- app-network
cli:
container_name: cli
working_dir: /home/default/project
build:
context: .
dockerfile: .devcontainer/Dockerfile
env_file: .env
volumes:
- wordpress:/usr/src/wordpress
- ./wordpress/vendor:/usr/src/wordpress/vendor
- ./wordpress/wp-content:/usr/src/wordpress/wp-content
- ./wordpress/wp-config.php:/usr/src/wordpress/wp-config.php
- ./:/home/default/project
- ~/.ssh:/home/default/.ssh
- ~/.gitconfig:/home/default/.gitconfig
- ./wordpress/docker/php/conf.d/memory_limit.ini:/usr/local/etc/php/conf.d/memory_limit.ini
restart: unless-stopped
networks:
- app-network
volumes:
wordpress:
dbdata:
networks:
app-network:
driver: bridge