-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdocker-compose.yml
286 lines (260 loc) · 7.01 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
version: '2'
services:
storage:
image: busybox:latest
container_name: project
volumes:
- ./:/srv
varnish: # caching load-balancer
image: eeacms/varnish # https://github.com/eea/eea.docker.varnish
container_name: varnish
ports:
- 80:6081
environment:
- BACKENDS=nginx
- BACKENDS_PROBE_INTERVAL=30s
- BACKENDS_PROBE_TIMEOUT=5s
volumes:
- ./varnish/config/varnish.vcl:/etc/varnish/conf.d/x-01-magento.vcl
- ./varnish/config/magento.vcl:/etc/varnish/conf.d/x-02-magento.vcl
labels:
container_group: web
depends_on:
- nginx
nginx:
image: nginx
container_name: nginx
volumes_from:
- storage
volumes:
- ./nginx/config/nginx-web.conf:/etc/nginx/conf.d/default.conf
working_dir: /srv/www
labels:
container_group: web
depends_on:
- php
php:
build: ./php/docker
container_name: php
volumes_from:
- storage
volumes:
- ./php/config/php.ini:/usr/local/etc/php/php.ini
working_dir: /srv/www
labels:
container_group: web
depends_on:
- mysql
- memcache
php_cli:
build: ./php/docker
container_name: php_cli
volumes_from:
- storage
volumes:
- ./php/config/php.ini:/usr/local/etc/php/php.ini
working_dir: /srv/www
depends_on:
- mysql
- memcache
user: www-data
command: php
mysql:
image: mysql:latest
container_name: mysql
volumes:
- ./mysql/data/:/var/lib/mysql
environment:
- MYSQL_DATABASE=magento
- MYSQL_ROOT_PASSWORD=root
labels:
container_group: storage
sphinx: # full-text search
build: ./sphinxsearch/docker
container_name: sphinx
ports:
- 6007:8080
volumes:
- ./sphinxsearch/config/sphinx.conf:/etc/sphinxsearch/sphinx.conf
- ./sphinxsearch/data:/usr/local/sphinxsearch/data
labels:
container_group: storage
memcache: # session storage
image: memcached
container_name: memcache
labels:
container_group: storage
redis: # dedicated for Magento frontend and page caches
image: redis:3.0.7
container_name: redis
labels:
container_group: storage
mailcatcher: # smtp server from frontend
build: ./mailcatcher/docker
container_name: mailcatcher
ports:
- 6009:1080
labels:
container_group: mail
cron:
image: lodatol/cron
container_name: cron
environment:
- CRON_ENTRY=* * * * * wget -O /dev/null http://nginx/cron.php
labels:
container_group: web
kibana: # logs frontend
image: kibana:4.5.4
container_name: kibana
ports:
- 6008:5601
labels:
container_group: logging
elasticsearch: # logs storage & full-text search
image: elasticsearch:2.3.5
container_name: elasticsearch
ports:
- 9200:9200
labels:
container_group: storage
curator: # manage time-based indices
image: bobrik/curator
container_name: curator
volumes:
- ./curator/config/action-file.yml:/action-file.yml
- ./curator/config/config.yml:/config.yml
labels:
container_group: monitoring
redis_log: # dedicated for logging bridge
image: redis:3.0.7
container_name: redis_log
labels:
container_group: storage
logstash: # forwards logs through Redis from logsprout to Elasticsearch
image: logstash:2.3.4
container_name: logstash
command: 'logstash -f /logstash.conf -v'
volumes:
- ./logstash/config/logstash.conf:/logstash.conf
labels:
container_group: logging
logspout: # aggregates logs from all containers and sends them to Redis
image: rtoma/logspout-redis-logstash:0.1.8
container_name: logspout
command: 'redis://redis_log'
environment:
- DEBUG=true
- REDIS_KEY=logstash
- REDIS_DOCKER_HOST=magento
#- REDIS_LOGSTASH_TYPE=docker
- DEDOT_LABELS=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
container_group: logging
depends_on:
- redis_log
nodeexporter: # forwards host metrics to Prometheus
image: prom/node-exporter
container_name: nodeexporter
ports:
- 6001:9100
expose:
- 9100
restart: always
labels:
container_group: monitoring
cadvisor: # forward container metrics to Prometheus
image: google/cadvisor
container_name: cadvisor
ports:
- 6002:8080
volumes:
- "/:/rootfs:ro"
- "/var/run:/var/run:rw"
- "/sys:/sys:ro"
- "/var/lib/docker/:/var/lib/docker:ro"
restart: always
labels:
container_group: monitoring
prometheus: # storage for search backend, gets all metrics from cAdvisor and Nodeexporter and prepares for Grafana
image: prom/prometheus
container_name: prometheus
ports:
- 6003:9090
volumes:
#- ./prometheus/data:/prometheus
- ./prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/config/rules:/etc/prometheus
restart: always
labels:
container_group: monitoring
command:
- "-config.file=/etc/prometheus/prometheus.yml"
- "-storage.local.path=/prometheus"
- "-web.console.libraries=/etc/prometheus/console_libraries"
- "-web.console.templates=/etc/prometheus/consoles"
- "-web.listen-address=:9090"
- "-alertmanager.url=http://alertmanager:9093"
- "-storage.local.memory-chunks=300000"
- "-storage.local.retention=744h"
grafana:
image: grafana/grafana
container_name: grafana
ports:
- 6004:3000
volumes:
- ./grafana/data:/var/lib/grafana
restart: always
labels:
container_group: monitoring
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
alertmanager: # forward metrics related to alerts to Prometheus
image: prom/alertmanager
container_name: alertmanager
ports:
- 6005:9093
restart: always
volumes:
- ./alertmanager/config:/etc/alertmanager/
#- ./storage/alertmanager/:/alertmanager
command:
- '-config.file=/etc/alertmanager/config.yml'
- '-storage.path=/tmp'
labels:
container_group: monitoring
portainer:
image: portainer/portainer
container_name: portainer
ports:
- 6006:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
container_group: monitoring
gitlab:
image: gitlab/gitlab-ce:8.15.2-ce.0
container_name: gitlab1
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab:7070'
ports:
- 7070:7070
- 22:22
volumes:
- ./gitlab/config:/etc/gitlab
- ./gitlab/logs:/var/log/gitlab
- ./gitlab/data:/var/opt/gitlab
gitlabrunner: # todo static ip for gitlab container and update toml
image: gitlab/gitlab-runner:latest
container_name: gitlabrunner1
restart: always
volumes:
- ./gitlab-runner/config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
default:
driver: bridge