forked from meanbee/docker-magento2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-build.yml
180 lines (171 loc) · 4.01 KB
/
docker-compose-build.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
# Declare your hostname before running docker-compose
# $ export M2SETUP_PROJECT=myproject
version: "2"
services:
varnish:
container_name: varnish.${M2SETUP_PROJECT}
build:
context: varnish/
environment:
- VIRTUAL_HOST=${M2SETUP_VIRTUAL_HOST}
- VIRTUAL_PORT=80
- HTTPS_METHOD=redirect
ports:
- '${M2SETUP_PORT_80}:80'
links:
- web
web:
container_name: web.${M2SETUP_PROJECT}
build:
context: nginx/
ports:
- '${M2SETUP_PORT_443}:443'
- 80
links:
- fpm
- db
volumes_from:
- appdata
env_file:
- global.env
environment:
- VIRTUAL_HOST=${M2SETUP_PROJECT}
- VIRTUAL_PORT=80
- HTTPS_METHOD=redirect
- M2SETUP_WEB_HOST=web
pagekite:
container_name: pagekite.${M2SETUP_PROJECT}
build:
context: pagekite/
environment:
# same as M2SETUP_WEB_HOST
- PAGEKITE_LOCAL_HOST=web
- M2SETUP_MAIL_HOST=mailcatcher
# - DEBUG=true
env_file:
- global.env
links:
- web
fpm:
container_name: fpm.${M2SETUP_PROJECT}
hostname: fpm.${M2SETUP_PROJECT}
build:
context: fpm/
args:
- M2SETUP_PHP=${M2SETUP_PHP}
- DOCKER_UID=1000
- DOCKER_GID=1000
expose:
- 9000
ports:
- '${M2SETUP_PORT_9000}:9000'
links:
- db
- mailcatcher
volumes_from:
- appdata
env_file:
- global.env
environment:
# Mailcatcher set up
- USE_MAILCATCHER=true
- SMTP_HOST=mailcatcher
- SMTP_PORT=1025
- SMTP_REWRITE_DOMAIN=${M2SETUP_VIRTUAL_HOST}
db:
container_name: db.${M2SETUP_PROJECT}
image: mariadb:10
ports:
- '${M2SETUP_PORT_3306}:3306'
volumes_from:
- dbdata
volumes:
- './db/my.conf:/etc/mysql/conf.d/magento.conf'
environment:
- MYSQL_ROOT_PASSWORD=magento2
- MYSQL_DATABASE=magento2
- MYSQL_USER=magento2
- MYSQL_PASSWORD=magento2
cli:
hostname: cli.${M2SETUP_PROJECT}
container_name: cli.${M2SETUP_PROJECT}
build:
context: cli/
args:
- M2SETUP_PHP=${M2SETUP_PHP}
- DOCKER_UID=1000
- DOCKER_GID=1000
links:
- db
ports:
- '${M2SETUP_PORT_9001}:9001'
volumes:
- '~/.composer/cache:/var/www/.composer/cache'
volumes_from:
- appdata
env_file:
- ./global.env
- ./composer.env
environment:
- ENABLE_SENDMAIL=false
- M2SETUP_INSTALL_DB=true
- M2SETUP_DB_HOST=db
- M2SETUP_DB_NAME=magento2
- M2SETUP_DB_USER=magento2
- M2SETUP_DB_PASSWORD=magento2
- M2SETUP_BASE_URL=http://${M2SETUP_VIRTUAL_HOST}/
- M2SETUP_SECURE_BASE_URL=https://${M2SETUP_VIRTUAL_HOST}/
- M2SETUP_BACKEND_FRONTNAME=admin
- M2SETUP_ADMIN_FIRSTNAME=Admin
- M2SETUP_ADMIN_LASTNAME=User
- M2SETUP_ADMIN_USER=admin
- M2SETUP_ADMIN_PASSWORD=qweqwe1
- M2SETUP_VERSION=2.3
#- M2SETUP_USE_SAMPLE_DATA=false
- M2SETUP_PROJECT_TYPE=community
# Mailcatcher set up
- USE_MAILCATCHER=true
- SMTP_HOST=mailcatcher
- SMTP_PORT=1025
- SMTP_REWRITE_DOMAIN=${M2SETUP_VIRTUAL_HOST}
- CRON_SCHEDULE=#
cron:
hostname: cron.${M2SETUP_PROJECT}
container_name: cron.${M2SETUP_PROJECT}
build:
context: cli/
args:
- M2SETUP_PHP=${M2SETUP_PHP}
- DOCKER_UID=1000
- DOCKER_GID=1000
command: run-cron
environment:
- ENABLE_SENDMAIL=false
# Mailcatcher set up
- USE_MAILCATCHER=true
- SMTP_HOST=mailcatcher
- SMTP_PORT=1025
- SMTP_REWRITE_DOMAIN=${M2SETUP_VIRTUAL_HOST}
volumes_from:
- appdata
links:
- db
env_file:
- ./cron.env
mailcatcher:
image: yappabe/mailhog
environment:
DNSDOCK_ALIAS: mailhog.${M2SETUP_PROJECT}
container_name: mailcatcher.${M2SETUP_PROJECT}
ports:
# HTTP web UI 8080 port mapping
- "${M2SETUP_PORT_8080}:8025"
appdata:
image: tianon/true
volumes:
- ./magento:/var/www/magento
dbdata:
image: tianon/true
volumes:
- /var/lib/mysql