-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.example.yml
175 lines (163 loc) · 6.22 KB
/
docker-compose.example.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
166
167
168
169
170
171
172
173
174
175
version: '3'
# Reach Digital - Magento 2 Docker development environment
services:
# https by default with https://github.com/varnish/hitch
#
# You can use any domain that points to 127.0.0.1, you can't use https://localhost because Magento can't handle that.
#
# bin/magento config:set --lock-env web/unsecure/base_url https://blabla.localhost.reachdigital.io/
# bin/magento config:set --lock-env web/secure/base_url https://blabla.localhost.reachdigital.io/
hitch:
image: hitch
ports:
- 443:443
volumes:
- ./vendor/reach-digital/docker-devbox/hitch/*.localhost.reachdigital.io.pem:/etc/hitch/certs/*.localhost.reachdigital.io:ro
command: --backend=[varnish]:8443 /etc/hitch/certs/*.localhost.reachdigital.io
depends_on:
- varnish
# Cache by default with https://www.varnish-software.com/
#
# bin/magento setup:config:set --http-cache-hosts=127.0.0.1:6081
# bin/magento config:set --lock-config system/full_page_cache/caching_application 2
#
# You can use bin/magento cache:clean or cache:flush to flush Varnish.
# You can use CMD+SHIFT+R to bypass the cache for a page
varnish:
image: varnish:6.6-alpine
volumes:
- ./vendor/reach-digital/docker-devbox/varnish/default.vcl:/etc/varnish/default.vcl:ro
- ./vendor/reach-digital/docker-devbox/varnish/secret:/etc/varnish/secret:ro
ports:
- 6081:80
- 6082:6082
command: "-p feature=+http2 -T :6082 -S /etc/varnish/secret"
depends_on:
- nginx
# phplogs: tail -f /usr/local/var/log/php*
nginx:
image: nginx:alpine
volumes:
- ./vendor/reach-digital/docker-devbox/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.template:ro
- ./vendor/reach-digital/docker-devbox/nginx/conf.d/default-map.conf:/etc/nginx/conf.d/default-map.conf:ro
- ./nginx-frontend.conf:/etc/nginx/conf.d/frontend.conf:ro
- ./vendor/reach-digital/docker-devbox/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- nginx-mount:/var/www/data
environment:
FPM_PORT: 9081
FPM_XDEBUG: 9181
FPM_ROOT: $PWD/pub
MAGE_RUN_TYPE: store #or set to website
command: /bin/sh -c "envsubst '$$MAGE_RUN_TYPE $$FPM_PORT $$FPM_XDEBUG $$FPM_ROOT $$FPM_ROOT_ABS' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
# http://localhost:4551/
# Adding your authtoken will grant you access to more features and longer session times.
ngrok:
platform: linux/x86_64
image: shkoliar/ngrok:latest
ports:
- 4551:4551
links:
- nginx
environment:
- PARAMS=http -region=eu nginx:80
# - PARAMS=http -region=eu --authtoken=<token> nginx:80
mysql:
image: perconalab/percona-server:8.0.33-25.1-multi
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
MYSQL_USER: magento
MYSQL_PASSWORD: magento
volumes:
- ./vendor/reach-digital/docker-devbox/mysql:/etc/my.cnf.d
- mysql-mount:/var/lib/mysql
- mysql-logs-mount:/var/log/mysql
security_opt:
- seccomp:unconfined
# bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-db=0 --cache-backend-redis-port=6379
# bin/magento setup:config:set --session-save=redis --session-save-redis-db=2 --session-save-redis-port=6379
redis:
image: redis:5-alpine
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-mount:/data
ports:
- 6379:6379
# bin/magento config:set --lock-config catalog/search/enable_eav_indexer 0
# bin/magento config:set --lock-config catalog/search/engine elasticsearch7
# bin/magento config:set --lock-env catalog/search/elasticsearch6_server_port 9200
# bin/magento config:set --lock-env catalog/search/elasticsearch6_server_hostname localhost
elasticsearch:
build: ./vendor/reach-digital/docker-devbox/elasticsearch
ports:
- 9200:9200
- 9300:9300
environment:
- discovery.type=single-node
- http.port=9200
- http.cors.enabled=true
- http.cors.allow-origin=http://localhost:9100
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials=true
- cluster.routing.allocation.disk.threshold_enabled=false
- cluster.routing.allocation.disk.watermark.flood_stage=200mb
- cluster.routing.allocation.disk.watermark.low=500mb
- cluster.routing.allocation.disk.watermark.high=300mb
- "ES_JAVA_OPTS=-Xmx1g -Xms1g"
volumes:
- elasticsearch-mount:/usr/share/elasticsearch/data
kibana:
image: kibana:7.17.9
ports:
- 5601:5601
environment:
ELASTICSEARCH_HOSTS: '["http://elasticsearch:9200"]'
depends_on:
- elasticsearch
# Magento >=2.4.6 supports custom SMTP config uit of the box:
#
# bin/magento config:set --lock-env system/smtp/disable 0
# bin/magento config:set --lock-env system/smtp/transport smtp
# bin/magento config:set --lock-env system/smtp/host localhost
# bin/magento config:set --lock-env system/smtp/port 1025
#
# For Magento <2.4.6 refer to https://github.com/ho-nl/docker-development-box/blob/dc9b236695/docker-compose.yml#L129-L137
mailcrab:
image: marlonb/mailcrab:latest
ports:
- 1025:1025
- 8025:1080
# bin/magento setup:config:set --amqp-host=localhost --amqp-port=5672 --amqp-user=guest --amqp-password=guest
# http://localhost:15672
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- 5672:5672
- 15672:15672
volumes:
- rabbitmq-mount:/var/lib/rabbitmq
# Create NFS mounts for the containers to access files on the host.
volumes:
nginx-mount:
driver: local
driver_opts:
type: nfs
o: addr=host.docker.internal,rw,nolock,hard,nointr,wsize=32768,rsize=32768,nfsvers=3
device: ":${PWD}"
mysql-mount:
driver: local
driver_opts:
type: nfs
o: addr=host.docker.internal,rw,nolock,hard,nointr,wsize=32768,rsize=32768,nfsvers=3
device: ":${PWD}/var/.mysqldata"
elasticsearch-mount:
driver: local
driver_opts:
type: nfs
o: addr=host.docker.internal,rw,nolock,hard,nointr,wsize=32768,rsize=32768,nfsvers=3
device: ":${PWD}/var/.esdata"
rabbitmq-mount:
redis-mount:
mysql-logs-mount: