This repository has been archived by the owner on Feb 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.magento.yml
173 lines (162 loc) · 4.43 KB
/
docker-compose.magento.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
version: '3.7'
services:
db:
hostname: db.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-db
image: '${DATABASE_IMAGE}'
shm_size: 2gb
environment:
- MYSQL_ROOT_PASSWORD=${COMPOSE_PROJECT_NAME}1234
- MYSQL_DATABASE=${COMPOSE_PROJECT_NAME}
- MYSQL_USER=${COMPOSE_PROJECT_NAME}
- MYSQL_PASSWORD=${COMPOSE_PROJECT_NAME}1234
ports:
- "${DATABASE_PORT:-3306}:3306"
volumes:
- 'magento-db:/var/lib/mysql'
healthcheck:
test: 'mysqladmin ping -h localhost -p${COMPOSE_PROJECT_NAME}1234'
interval: 30s
timeout: 30s
retries: 3
networks:
magento:
aliases:
- db.magento2.docker
redis:
hostname: redis.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-redis
image: '${REDIS_IMAGE}'
ports:
- "${REDIS_PORT:-6379}: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
container_name: ${COMPOSE_PROJECT_NAME}-elasticsearch
image: '${ELASTICSEARCH_IMAGE}'
ulimits:
memlock:
soft: -1
hard: -1
environment:
- 'cluster.name=docker-cluster'
- 'bootstrap.memory_lock=true'
ports:
- "${ELASTICSEARCH_PORT:-9200}:9200"
volumes:
- 'magento-elasticsearch:/usr/share/elasticsearch/data'
networks:
magento:
aliases:
- elasticsearch.magento2.docker
rabbitmq:
hostname: rabbitmq.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-rabbitmq
image: '${RABBITMQ_IMAGE}'
ports:
- "${RABBITMQ_PORT:-15672}:15672"
- "${RABBITMQ_WEB_PORT:-5672}:5672"
networks:
magento:
aliases:
- rabbitmq.magento2.docker
fpm:
hostname: fpm.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-fpm
image: '${PHP_FPM_IMAGE}'
ports:
- "9000"
volumes: &appvolumes
- './../../../:/app'
- '~/.local/share/certs/ssl:/etc/nginx/ssl/'
- '~/.composer:/app/.composer'
- './services/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf'
environment:
- 'MAGENTO_RUN_MODE=${MAGE_RUN_MODE}'
- 'PHP_EXTENSIONS=${PHP_EXTENSIONS}'
networks:
magento:
aliases:
- fpm.magento2.docker
mailhog:
fpm_xdebug:
hostname: fpm_xdebug.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-fpm_xdebug
image: '${PHP_FPM_IMAGE}'
volumes: *appvolumes
environment:
- 'MAGENTO_RUN_MODE=${MAGE_RUN_MODE}'
- 'PHP_EXTENSIONS=${PHP_EXTENSIONS} xdebug'
- 'PHP_IDE_CONFIG=serverName=magento_cloud_docker'
- 'XDEBUG_CONFIG=remote_host=host.docker.internal'
networks:
magento:
aliases:
- fpm_xdebug.magento2.docker
mailhog:
web:
hostname: web.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-web
image: '${NGINX_IMAGE}'
ports:
- "${WEB_PORT:-80}:80"
- "${WEB_SSL_PORT:-443}:443"
volumes: *appvolumes
environment:
- 'MAGENTO_RUN_MODE=${MAGE_RUN_MODE}'
- 'WITH_XDEBUG=1'
- 'NGINX_WORKER_PROCESSES=1'
- 'NGINX_WORKER_CONNECTIONS=1024'
networks:
magento:
aliases:
- web.magento2.docker
varnish:
hostname: varnish.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-varnish
image: '${VARNISH_IMAGE}'
networks:
magento:
aliases:
- varnish.magento2.docker
deploy:
hostname: deploy.magento2.docker
container_name: ${COMPOSE_PROJECT_NAME}-deploy
image: '${PHP_CLI_IMAGE}'
environment:
- 'COMPOSER_VERSION=${COMPOSER_VERSION}'
- 'MAGENTO_RUN_MODE=${MAGE_RUN_MODE}'
- 'PHP_EXTENSIONS=${PHP_EXTENSIONS} ${PHP_CLI_XDEBUG}'
- 'PHP_IDE_CONFIG=serverName=magento_cloud_docker'
- 'XDEBUG_CONFIG=remote_host=host.docker.internal'
volumes: *appvolumes
entrypoint: [ '/docker-entrypoint.sh', 'tail', '-f', '/dev/null']
networks:
- magento
- mailhog
volumes:
magento-db:
name: ${COMPOSE_PROJECT_NAME}-magento-db
magento-elasticsearch:
name: ${COMPOSE_PROJECT_NAME}-magento-elasticsearch
networks:
magento:
driver: bridge
mailhog:
name: mailhog
driver: bridge