-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
231 lines (220 loc) · 6.49 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
services:
reverse-proxy:
container_name: ${PROJECT_NAME}-traefik
image: arm64v8/traefik:3.2
command:
- "--api.insecure=false"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--log.level=DEBUG"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.network=magento"
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
- "--entrypoints.http.http.redirections.entrypoint.to=https"
- "--entrypoints.http.http.redirections.entrypoint.scheme=https"
- "--entrypoints.https.http.tls.certResolver=le"
- "--certificatesresolvers.le.acme.tlschallenge=true"
- "--certificatesresolvers.le.acme.email=admin@${PROJECT_VIRTUAL_HOST}"
- "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${PROJECT_VIRTUAL_HOST}`)"
- "traefik.http.routers.dashboard.entrypoints=https"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=traefik:$$apr1$$gNa7n0/R$$XOc09tOvpfv0FBWZ07upA1"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./letsencrypt:/letsencrypt
networks:
- magento
nginx:
build: ./nginx
container_name: ${PROJECT_NAME}-nginx
volumes:
- ./magento2:/home/magento:cached
networks:
- magento
labels:
- "traefik.enable=false"
expose:
- "8080"
php-fpm:
build: ./php-fpm
container_name: ${PROJECT_NAME}-php-fpm
volumes:
- ./magento2:/home/magento:cached
- ./php-fpm/php.ini:/etc/php.ini
networks:
- magento
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
php-fpm-xdebug:
build: ./php-fpm-xdebug
container_name: ${PROJECT_NAME}-php-fpm-xdebug
volumes:
- ./magento2:/home/magento:cached
- ./php-fpm/php.ini:/etc/php.ini
networks:
- magento
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
environment:
PHP_IDE_CONFIG: "serverName=Docker"
XDEBUG_CONFIG: "client_host=host.docker.internal"
profiles:
- xdebug
redis:
image: arm64v8/redis:7.0
container_name: ${PROJECT_NAME}-redis
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
ports:
- "6379:6379"
networks:
- magento
mysql:
image: arm64v8/mysql:8.0.34
container_name: ${PROJECT_NAME}-mysql
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
volumes:
- ./mysql/mysqld.cnf:/etc/mysql/conf.d/mysqld.cnf
- ./mysql/db:/var/lib/mysql
environment:
MYSQL_DATABASE: 'magento_db'
MYSQL_ROOT_PASSWORD: 'root_pass'
MYSQL_USER: 'magento_user'
MYSQL_PASSWORD: 'PASSWD#'
MYSQL_ALLOW_EMPTY_PASSWORD: 'false'
ports:
- "3308:3306"
networks:
- magento
mailpit:
image: axllent/mailpit:v1.21
container_name: ${PROJECT_NAME}-mailpit
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
- "traefik.http.routers.mailpit.rule=Host(`mail.${PROJECT_VIRTUAL_HOST}`)"
- "traefik.http.services.mailpit.loadbalancer.server.port=8025"
volumes:
- ./data:/data
ports:
- "1025:1025"
- "8025:8025"
networks:
- magento
environment:
MP_MAX_MESSAGES: 5000
MP_DATABASE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
expose:
- "8025"
rabbitmq:
image: arm64v8/rabbitmq:3.11-management
container_name: ${PROJECT_NAME}-rabbitmq
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
- "traefik.http.routers.rabbitmq.rule=Host(`rabbit.${PROJECT_VIRTUAL_HOST}`)"
- "traefik.http.routers.rabbitmq.middlewares=strip-docs"
- "traefik.http.middlewares.strip-docs.stripprefix.prefixes=/rmq"
- "traefik.http.services.rabbitmq.loadbalancer.server.port=15672"
ports:
- "15672:15672"
- "5672:5672"
networks:
- magento
expose:
- "15672"
opensearch:
image: opensearchproject/opensearch:2.5.0
container_name: ${PROJECT_NAME}-opensearch
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
- "traefik.http.routers.search.rule=Host(`search.${PROJECT_VIRTUAL_HOST}`)"
ports:
- "9200:9200"
- "9600:9600"
networks:
- magento
environment:
- "discovery.type=single-node"
- "bootstrap.memory_lock=true"
- "OPENSEARCH_JAVA_OPTS=-Xms2048m -Xmx2048m"
- "http.host=0.0.0.0"
- "DISABLE_SECURITY_PLUGIN=true"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
opensearch-dashboard:
image: opensearchproject/opensearch-dashboards:2.5.0
container_name: ${PROJECT_NAME}-opensearch-dashboard
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
- "traefik.http.services.kibana-svc.loadbalancer.server.port=5601"
- "traefik.domain=dashboard.${PROJECT_VIRTUAL_HOST}"
- "traefik.http.routers.kibana-rtr.service=kibana-svc"
- "traefik.http.routers.kibana-rtr.entrypoints=https"
- "traefik.http.routers.kibana-rtr.rule=Host(`dashboard.${PROJECT_VIRTUAL_HOST}`)"
networks:
- magento
environment:
- "OPENSEARCH_HOSTS=http://opensearch:9200"
- "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true"
ports:
- "5601:5601"
expose:
- "5601"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
varnish:
build: ./varnish
container_name: ${PROJECT_NAME}-varnish
labels:
- "traefik.enable=true"
- "traefik.docker.network=magento"
- "traefik.http.routers.varnish.rule=Host(`${PROJECT_VIRTUAL_HOST}`)"
- "traefik.http.routers.varnish.entrypoints=https"
- "traefik.http.services.varnish.loadbalancer.server.port=6081"
networks:
- magento
ports:
- "6081:6081"
depends_on:
- nginx
links:
- nginx
volumes:
- ./varnish/varnish.vcl:/etc/varnish/default.vcl
environment:
- CACHE_SIZE=1G
expose:
- "6081"
command: ["varnishd", "-F", "-a", ":6081", "-b", "nginx:8080"]
networks:
magento:
driver: bridge