-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-production_with-varnish.yml
141 lines (128 loc) · 3.67 KB
/
docker-compose-production_with-varnish.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
version: '3'
services:
mysql:
image: mysql:5.7
ports:
- "33060:3306"
environment:
MYSQL_USER: magento
MYSQL_PASSWORD: magento
MYSQL_ROOT_PASSWORD: magento
MYSQL_DATABASE: magento
networks:
- "magento"
volumes:
- ./var/lib/mysql:/var/lib/mysql
- /var/run/mysqld:/var/run/mysqld
- ./config/mysql/my.cnf:/etc/alternatives/my.cnf
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: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:
- "magento"
cli:
image: magento/magento-cloud-docker-php:7.4-cli-1.1
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:
- "magento"
fpm:
image: magento/magento-cloud-docker-php:7.4-fpm-1.1
volumes: *appvolumes
env_file: ./config/common.env
environment: *appenvironment
networks:
- "magento"
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
networks:
- "magento"
redis:
image: 'redis:5.0'
volumes:
- /data
ports:
- 6379
networks:
- "magento"
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:
- "magento"
volumes:
- '~/data/:/data:ro'
tls:
image: 'magento/magento-cloud-docker-tls:latest-1.0'
ports:
- '443:443'
external_links:
- 'varnish:varnish'
depends_on:
- varnish
networks:
- "magento"
volumes:
- '~/data/certs:/certs:ro'
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:
- "magento"
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