-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
119 lines (113 loc) · 3.37 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
name: $PROJECT_NAME
networks:
default:
proxy:
name: ${PROXY:-proxy}
external: TRUE
volumes:
site-database:
site-database-log:
site-public:
site-private:
services:
mailpit:
image: axllent/mailpit:latest
hostname: $PROJECT_NAME-mailpit
container_name: $PROJECT_NAME-mailpit
environment:
VIRTUAL_HOST: mail.$SITE_DOMAIN
VIRTUAL_PORT: 80
VIRTUAL_NETWORK: ${PROXY:-proxy}
HTTPS_METHOD: noredirect
MP_SMTP_BIND_ADDR: 0.0.0.0:25
MP_UI_BIND_ADDR: 0.0.0.0:80
labels:
caddy: mail.$SITE_DOMAIN
caddy.reverse_proxy: "{{upstreams}}"
expose:
- "25"
networks:
default:
aliases:
- smtp
proxy:
memcache:
image: public.ecr.aws/unocha/memcache:1.6
hostname: $PROJECT_NAME-memcache
container_name: $PROJECT_NAME-memcache
environment:
MEMCACHE_MAX_MEMORY: 64
expose:
- "11211"
networks:
- default
mysql:
image: public.ecr.aws/unocha/mysql:10.11
hostname: $PROJECT_NAME-mysql
container_name: $PROJECT_NAME-mysql
environment:
MYSQL_DB:
MYSQL_USER:
MYSQL_PASS:
volumes:
- "site-database:/var/lib/mysql:rw"
- "site-database-log:/var/log/mysql:rw"
networks:
- default
site:
image: public.ecr.aws/unocha/$IMAGE_NAME:$IMAGE_TAG
hostname: $PROJECT_NAME-site
container_name: $PROJECT_NAME-site
depends_on:
- memcache
- mysql
volumes:
- "./shared/settings:/srv/www/shared/settings:ro"
# Mount volumes for the private and public files.
- "site-public:/srv/www/html/sites/default/files:rw"
- "site-private:/srv/www/html/sites/default/private:rw"
# Mount the folders needed for the tests.
- "../phpcs.xml:/srv/www/phpcs.xml:ro"
- "../phpunit.xml:/srv/www/phpunit.xml:ro"
# Mount local custom code.
- "../html/modules/custom:/srv/www/html/modules/custom:rw"
- "../html/themes/custom:/srv/www/html/themes/custom:rw"
# Mount configuration and allow overriding it.
- "../config:/srv/www/config:rw"
- "../config_dev:/srv/www/config_dev:rw"
# Mount the composer files and patches.
- "../composer.json:/srv/www/composer.json:rw"
- "../composer.patches.json:/srv/www/composer.patches.json:rw"
- "../composer.lock:/srv/www/composer.lock:rw"
- "../PATCHES:/srv/www/PATCHES:rw"
# # Mount contrib modules and themes.
# - "../html/modules/contrib:/srv/www/html/modules/contrib:rw"
# - "../html/themes/contrib:/srv/www/html/themes/contrib:rw"
# Mount nginx custom configuration.
# - "../docker/etc/nginx/custom:/etc/nginx/custom"
environment:
TERM: xterm
ENVIRONMENT: local
NGINX_SERVERNAME: $SITE_DOMAIN
NGINX_OVERRIDE_PROTOCOL: HTTP,$SITE_DOMAIN
DRUSH_OPTIONS_URI: https://$SITE_DOMAIN
DRUPAL_DB_DATABASE: $MYSQL_DB
DRUPAL_DB_USERNAME: $MYSQL_USER
DRUPAL_DB_PASSWORD: $MYSQL_PASS
DRUPAL_DB_HOST: mysql
DRUPAL_DB_DRIVER: mysql
PHP_ENVIRONMENT:
# Rate limiting.
NGINX_LIMIT_HUMANS: 1024r/s
NGINX_BURST_HUMANS: 1024
# Local proxy.
VIRTUAL_HOST: $SITE_DOMAIN
VIRTUAL_PORT: 80
VIRTUAL_NETWORK: ${PROXY:-proxy}
HTTPS_METHOD: noredirect
labels:
caddy: $SITE_DOMAIN
caddy.reverse_proxy: "{{upstreams}}"
networks:
- default
- proxy