-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
184 lines (184 loc) · 4.6 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
# ./vendor/bin/ece-docker 'build:compose' --mode=developer --php='8.1' --nginx='1.19' --expose-db-port=3306 --no-varnish
version: '2.1'
services:
db:
hostname: db.magento2.docker
image: 'mariadb:10.3'
shm_size: 2gb
environment:
- MYSQL_ROOT_PASSWORD=magento2
- MYSQL_DATABASE=magento2
- MYSQL_USER=magento2
- MYSQL_PASSWORD=magento2
ports:
- '3306:3306'
volumes:
- '.:/app:delegated'
- 'mymagento-magento-db:/var/lib/mysql'
healthcheck:
test: 'mysqladmin ping -h localhost -pmagento2'
interval: 30s
timeout: 30s
retries: 3
networks:
magento:
aliases:
- db.magento2.docker
redis:
hostname: redis.magento2.docker
image: 'redis:5.0'
volumes:
- '.:/app:delegated'
ports:
- 6379
sysctls:
net.core.somaxconn: 1024
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
healthcheck:
test: 'redis-cli ping || exit 1'
interval: 30s
timeout: 30s
retries: 3
networks:
magento:
aliases:
- redis.magento2.docker
# elasticsearch:
# hostname: elasticsearch.magento2.docker
# image: 'magento/magento-cloud-docker-elasticsearch:7.10-1.3.2'
# ulimits:
# memlock:
# soft: -1
# hard: -1
# environment:
# - cluster.name=docker-cluster
# - bootstrap.memory_lock=true
# networks:
# magento:
# aliases:
# - elasticsearch.magento2.docker
opensearch:
hostname: opensearch.magento2.docker
image: 'magento/magento-cloud-docker-opensearch:2.4-1.3.5'
ulimits:
memlock:
soft: -1
hard: -1
environment:
- cluster.name=docker-cluster
- discovery.type=single-node
- discovery.seed_hosts=opensearch
- bootstrap.memory_lock=true
- DISABLE_SECURITY_PLUGIN=true
networks:
magento:
aliases:
- opensearch.magento2.docker
fpm:
hostname: fpm.magento2.docker
image: 'magento/magento-cloud-docker-php:8.1-fpm-1.3.2'
extends: generic
volumes:
- '.:/app:delegated'
networks:
magento:
aliases:
- fpm.magento2.docker
depends_on:
db:
condition: service_healthy
web:
hostname: web.magento2.docker
image: 'magento/magento-cloud-docker-nginx:1.19-1.3.2'
extends: generic
volumes:
- '.:/app:delegated'
environment:
- WITH_XDEBUG=0
- NGINX_WORKER_PROCESSES=1
- NGINX_WORKER_CONNECTIONS=1024
networks:
magento:
aliases:
- web.magento2.docker
depends_on:
fpm:
condition: service_started
tls:
hostname: tls.magento2.docker
image: 'magento/magento-cloud-docker-nginx:1.19-1.3.2'
extends: generic
networks:
magento:
aliases:
- magento2.docker
environment:
- NGINX_WORKER_PROCESSES=1
- NGINX_WORKER_CONNECTIONS=1024
- UPSTREAM_HOST=web
- UPSTREAM_PORT=8080
ports:
- '80:80'
- '443:443'
depends_on:
web:
condition: service_started
generic:
hostname: generic.magento2.docker
image: 'magento/magento-cloud-docker-php:8.1-cli-1.3.2'
env_file: ./.docker/config.env
environment:
- MAGENTO_RUN_MODE=developer
- 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium'
deploy:
hostname: deploy.magento2.docker
image: 'magento/magento-cloud-docker-php:8.1-cli-1.3.2'
extends: generic
volumes:
- '.:/app:delegated'
networks:
magento:
aliases:
- deploy.magento2.docker
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
opensearch:
condition: service_healthy
mailhog:
hostname: mailhog.magento2.docker
image: 'mailhog/mailhog:latest'
ports:
- '1025:1025'
- '8025:8025'
networks:
magento:
aliases:
- mailhog.magento2.docker
# cron:
# hostname: cron.magento2.docker
# image: 'magento/magento-cloud-docker-php:8.1-cli-1.3.2'
# extends: generic
# command: run-cron
# environment:
# CRONTAB: '* * * * * root cd /app && /usr/local/bin/php bin/magento cron:run >> /app/var/log/cron.log'
# volumes:
# - '.:/app:delegated'
# networks:
# magento:
# aliases:
# - cron.magento2.docker
# depends_on:
# db:
# condition: service_healthy
volumes:
mymagento-magento-db: { }
networks:
magento:
driver: bridge