-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
117 lines (104 loc) · 3.99 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
version: '3.6'
services:
# Route HTTP requests to specific containers based on the HTTP_HOST header.
nginx-proxy:
image: jwilder/nginx-proxy:1.3.1
depends_on:
- mkcert
ports:
- "80:80"
- "443:443"
volumes:
- ./local/certs:/etc/nginx/certs
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./local/docker/nginx-proxy/conf.d/custom.conf:/etc/nginx/conf.d/custom.conf
# Create a local DNS server that maps all *.local.wpenv.net to this environment when not connected to the internet.
# Append `--log-queries --log-facility=-` to the command to enable verbose logging to stderr of all lookups.
dnsmasq:
image: andyshinn/dnsmasq:2.83
# Enable only when needed.
# ports:
# - "53:53/udp"
cap_add:
- NET_ADMIN
command: --address=/${DEV_URL:-local.wpenv.net}/${DOCKER_HOST_IP:-"127.0.0.1"} --server=1.1.1.1
# Generate SSL certs for the local development environment.
mkcert:
image: ghcr.io/xwp/vip-site-template--mkcert:1.0.0
build: ./local/docker/mkcert
volumes:
- ./local/certs:/root/.local/share/mkcert
command: sh -c 'test -f "${DEV_URL:-local.wpenv.net}.crt" || mkcert -cert-file "${DEV_URL:-local.wpenv.net}.crt" -key-file "${DEV_URL:-local.wpenv.net}.key" "${DEV_URL:-local.wpenv.net}" "*.${DEV_URL:-local.wpenv.net}"'
# Sync VIP MySQL container and it's configurations - https://github.com/Automattic/vip-cli/blob/549a45a37bc254a39dba9ed23ac88174a35aa1da/assets/dev-env.lando.template.yml.ejs#L74-L75
db:
image: mysql:8.0
command: --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M --default-authentication-plugin=mysql_native_password
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
phpmyadmin:
image: phpmyadmin/phpmyadmin:5.2.1
depends_on:
- db
environment:
VIRTUAL_HOST: phpmyadmin.${DEV_URL:-local.wpenv.net}
PMA_HOST: db
PMA_USER: root
PMA_PASSWORD: root
# Capture all emails sent by WordPress.
mailhog:
image: mailhog/mailhog:v1.0.1
environment:
VIRTUAL_HOST: mail.${DEV_URL:-local.wpenv.net}
VIRTUAL_PORT: 8025
# For WP object caching.
memcached:
image: memcached:1.6
# Review Xdebug profiling data.
webgrind:
image: jokkedk/webgrind:latest
volumes:
- webgrind_data:/tmp
environment:
VIRTUAL_HOST: webgrind.${DEV_HOSTNAME:-local.wpenv.net}
# Enable VIP ElasticSearch https://docs.wpvip.com/technical-references/elasticsearch/
elasticsearch:
# Sync version with VIP settings https://github.com/Automattic/vip-cli/blob/0e5d5a1fc2761fc67d5e59ab3d817e7724b139e6/assets/dev-env.lando.template.yml.ejs#L99
image: elasticsearch:7.17.2
environment:
- discovery.type=single-node
- cluster.name=elasticsearch
- xpack.security.enabled=false
- bootstrap.memory_lock=true
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
wordpress:
depends_on:
- db
build: ./local/docker/wordpress
image: ghcr.io/xwp/vip-site-template--wordpress:2.1.0
restart: always
volumes:
- ./local/public:/var/www/html
- .:/var/www/html/wp-content
- ./vip-config:/var/www/html/vip-config # Match the VIP production setup where vip-config is mapped to the root directory.
- webgrind_data:/tmp
environment:
APACHE_DOCUMENT_ROOT: /var/www/html
VIRTUAL_HOST: ${DEV_URL:-local.wpenv.net}, *.${DEV_URL:-local.wpenv.net}
SMTPSERVER: mailhog
EMAIL: local@${DEV_URL:-local.wpenv.net}
XDEBUG_MODE: debug,coverage # Append `profile` to enable profiling or leave empty to disable all.
XDEBUG_CONFIG: client_host=host.docker.internal discover_client_host=0 # Required for MacOS only.
WP_PHPUNIT__TESTS_CONFIG: /var/www/html/wp-tests-config.php
volumes:
db_data:
webgrind_data:
elasticsearch_data: