-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
120 lines (109 loc) · 4.23 KB
/
docker-compose.yaml
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
# If you are not using Lando but Docker, this is a good starting point
# cSpell:ignore postname monthnum autotls wpms
version: '3'
services:
database:
image: mariadb
container_name: wordpress-plugin-starter-db
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-wordpress}
MYSQL_USER: ${MYSQL_USER:-wordpress}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-wordpress}
volumes:
- mariadb-data:/var/lib/mysql
cache:
image: redis:alpine
container_name: wordpress-plugin-starter-cache
mail:
image: mailhog/mailhog
container_name: wordpress-plugin-starter-mail
ports:
- "${MAILHOG_PORT:-8025}:8025"
wordpress:
build: ./
container_name: wordpress-plugin-starter-wp
ports:
- ${WORDPRESS_PORT:-8080}:80
environment:
WORDPRESS_DB_HOST: wordpress-plugin-starter-db
WORDPRESS_DB_NAME: ${MYSQL_DATABASE:-wordpress}
WORDPRESS_DB_USER: ${MYSQL_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD:-wordpress}
WORDPRESS_DEBUG: ${WORDPRESS_DEBUG:-0}
WORDPRESS_CONFIG_EXTRA: |
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
define( 'WP_REDIS_HOST', 'wordpress-plugin-starter-cache' );
define( 'WPMS_ON', true );
define( 'WPMS_SMTP_HOST', 'wordpress-plugin-starter-mail' );
define( 'WPMS_SMTP_PORT', 1025 );
define( 'WPMS_SSL', '' );
define( 'WPMS_SMTP_AUTH', false );
define( 'WPMS_SMTP_AUTOTLS', true );
define( 'WPMS_MAILER', 'smtp' );
volumes:
- ./:/var/www/html/wp-content/plugins/${PLUGIN_DIRNAME:-wordpress-plugin-starter}
depends_on:
- database
- cache
phpmyadmin:
image: phpmyadmin
container_name: wordpress-plugin-starter-pma
environment:
PMA_HOST: wordpress-plugin-starter-db
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_USER: ${MYSQL_USER:-wordpress}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-wordpress}
ports:
- ${PMA_PORT:-8081}:80
depends_on:
- database
wp-cli:
image: wordpress:cli-php8.0
container_name: wordpress-plugin-starter-cli
user: xfs
environment:
WORDPRESS_DB_HOST: wordpress-plugin-starter-db
WORDPRESS_DB_NAME: ${MYSQL_DATABASE:-wordpress}
WORDPRESS_DB_USER: ${MYSQL_USER:-wordpress}
WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD:-wordpress}
WP_CLI_PACKAGES_DIR: /tmp/wp-cli-packages # Prevent console errors
WORDPRESS_HOST: ${WORDPRESS_HOST:-localhost} # To pass to the installer
WORDPRESS_PORT: ${WORDPRESS_PORT:-8080}
WORDPRESS_ADMIN_USER: ${WORDPRESS_ADMIN_USER:-admin}
WORDPRESS_ADMIN_PASS: ${WORDPRESS_ADMIN_PASS:-pass}
WORDPRESS_CONFIG_EXTRA: |
define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', true);
define('WP_REDIS_HOST', 'wordpress-plugin-starter-cache');
volumes_from:
- wordpress
depends_on:
- database
- wordpress
command:
- sh
- -c
- |
sleep 10
echo "Installing WordPress in ${WORDPRESS_HOST}:${WORDPRESS_PORT}"
wp core install --path=/var/www/html --title=DEV --admin_user=${WORDPRESS_ADMIN_USER} --admin_password=${WORDPRESS_ADMIN_PASS} [email protected] --skip-email --url="http://${WORDPRESS_HOST}:${WORDPRESS_PORT}"
wp plugin delete akismet hello
wp plugin install redis-cache --activate
wp plugin install debug-bar --activate
wp plugin install query-monitor --activate
wp plugin install simply-show-hooks --activate
wp plugin install user-switching --activate
wp plugin install wp-mail-smtp --activate
wp redis enable
wp option update permalink_structure "/%year%/%monthnum%/%postname%/
echo "Access WordPress on http://${WORDPRESS_HOST}:${WORDPRESS_PORT}/wp-admin/ with User ${WORDPRESS_ADMIN_USER} and password ${WORDPRESS_ADMIN_PASS}"
echo "Access PhpMyAdmin on http://${WORDPRESS_HOST}:${PMA_PORT}/ with user root and password ${MYSQL_ROOT_PASSWORD}"
echo "Access MailHog on http://${WORDPRESS_HOST}:${MAILHOG_PORT}/"
networks:
default:
name: wp-custom-plugin-network
volumes:
mariadb-data:
# vim: ts=2 sw=2 et ft=yaml