-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yml
166 lines (157 loc) · 5.76 KB
/
docker-compose-dev.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
version: '3'
services:
web:
image: magento/magento-cloud-docker-nginx:latest
links:
- fpm
volumes: &appvolumes
- "./src:/app:delegated"
- "./config/cron/crontabs/root:/etc/cron.d/root"
- "./config/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf:ro"
#- "./config/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.template:ro"
#- "./composer/bin/composer:/usr/local/bin/composer:delegated"
- "./composer/auth.json:/root/.composer/auth.json:delegated"
#- "./composer/auth.json:/app/var/composer_home/auth.json:delegated"
- "~/.composer/cache:/root/.composer/cache:delegated"
#- "~/.composer/cache:/app/var/composer_home/cache:delegated"
env_file: ./config/common.env
environment:
- "VERBOSE:true"
- "HOSTNAME=${HOSTNAME}"
#command: >
# /bin/bash -c
# "envsubst '
# $${HOSTNAME}
# '< /etc/nginx/conf.d/default.template
# > /etc/nginx/conf.d/default.conf
# && nginx -g 'daemon off;'"
networks:
- "network-back"
- "traefik_default"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_default"
- "traefik.http.routers.${DOCKER_PREFIX:-web}.rule=Host(`${HOSTNAME:- }`)"
- "traefik.http.routers.${DOCKER_PREFIX:-web}.tls=true"
- "traefik.http.routers.${DOCKER_PREFIX:-web}.tls.certresolver=letsEncrypt"
- "traefik.http.routers.${DOCKER_PREFIX:-web}.entrypoints=websecure"
- "traefik.http.routers.${DOCKER_PREFIX:-web}.middlewares=${DOCKER_PREFIX:-web}@docker"
- "traefik.http.services.${DOCKER_PREFIX:-web}.loadbalancer.server.port=80"
- "traefik.http.middlewares.${DOCKER_PREFIX:-web}.compress=true"
cli:
image: magento/magento-cloud-docker-php:7.4-cli-1.2.2
volumes: *appvolumes
command: bash -c "${NEW_DATABASE_COMMAND:- }${COMPOSER_INSTALL_COMMAND:- }${MAGENTO_INSTALL_COMMAND:- } php bin/magento setup:store-config:set --base-url='https://${HOSTNAME:- }/'; php bin/magento setup:store-config:set --base-url-secure='https://${HOSTNAME:- }/'; php bin/magento c:fl; service cron start; crontab /etc/cron.d/root; rm -rf /app/generated/*; service sendmail stop; tail -f /dev/null"
env_file: ./config/common.env
environment: &appenvironment
- "VERBOSE=true"
- "UPDATE_UID_GID=true"
- "MAGENTO_RUN_MODE=developer"
- "ENABLE_SENDMAIL=true"
networks:
- "network-back"
- "traefik_default"
fpm:
image: magento/magento-cloud-docker-php:7.4-fpm-1.2.2
volumes: *appvolumes
env_file: ./config/common.env
environment: *appenvironment
networks:
- "network-back"
- "traefik_default"
elasticsearch:
image: magento/magento-cloud-docker-elasticsearch:7.7-1.1
#ports:
#- "9200:9200"
#- "9300:9300"
environment:
- "discovery.type=single-node"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- "./config/elasticsearch/plugins:/usr/share/elasticsearch/plugins"
- "./config/elasticsearch/config/analysis-ik:/usr/share/elasticsearch/config/analysis-ik"
networks:
- "network-back"
redis:
image: 'redis:5.0'
volumes:
- /data
ports:
- 6379
networks:
- "network-back"
# varnish:
# image: 'magento/magento-cloud-docker-varnish:latest-1.0'
# environment:
# - VIRTUAL_HOST=magento2.docker
# - VIRTUAL_PORT=80
# - HTTPS_METHOD=noredirect
## ports:
## - '80:80'
# depends_on:
# - web
# networks:
# - "network-back"
# - "traefik_default"
# volumes:
# - '~/data/:/data:ro'
# labels:
# - "traefik.enable=true"
# - "traefik.docker.network=traefik_default"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.rule=Host(`${HOSTNAME:- }`)"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.tls=true"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.tls.certresolver=letsEncrypt"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.entrypoints=websecure"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.middlewares=${DOCKER_PREFIX:-web}@docker"
# - "traefik.http.services.${DOCKER_PREFIX:-web}.loadbalancer.server.port=80"
# - "traefik.http.middlewares.${DOCKER_PREFIX:-web}.compress=true"
# tls:
# image: 'magento/magento-cloud-docker-tls:latest-1.0'
## ports:
## - '443:443'
# external_links:
# - 'varnish:varnish'
# depends_on:
# - varnish
# networks:
# - "network-back"
# - "traefik_default"
# volumes:
# - '~/data/certs:/certs:ro'
# labels:
# - "traefik.enable=true"
# - "traefik.docker.network=traefik_default"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.rule=Host(`${HOSTNAME:- }`)"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.tls=true"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.tls.certresolver=letsEncrypt"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.entrypoints=websecure"
# - "traefik.http.routers.${DOCKER_PREFIX:-web}.middlewares=${DOCKER_PREFIX:-web}@docker"
# - "traefik.http.services.${DOCKER_PREFIX:-web}.loadbalancer.server.port=443"
# - "traefik.http.middlewares.${DOCKER_PREFIX:-web}.compress=true"
cron:
image: 'magento/magento-cloud-docker-php:7.4-cli-1.1'
hostname: cron.magento2.docker
depends_on:
- redis
- elasticsearch
env_file: ./config/common.env
volumes: *appvolumes
networks:
- "network-back"
- "traefik_default"
environment:
CRONTAB: '* * * * * root cd /app && /usr/local/bin/php bin/magento cron:run >> /app/var/log/cron.log'
command: bash -c "/etc/init.d/sendmail start && run-cron"
networks:
# magento:
# driver: bridge
traefik_default:
external: true
network-back:
external: true