-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
207 lines (196 loc) · 5.16 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
version: "3.7"
services:
viz:
image: dockersamples/visualizer
hostname: swarm-viz
networks:
- overnet
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- CTX_ROOT=/viz
deploy:
placement:
constraints:
- node.role == manager
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.servicePath=/viz
- com.df.port=8080
listener:
image: dockerflow/docker-flow-swarm-listener:latest
hostname: swarm-listener
networks:
- overnet
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DF_NOTIFY_CREATE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/reconfigure
- DF_NOTIFY_REMOVE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/remove
deploy:
placement:
constraints:
- node.role == manager
proxy:
image: dockerflow/docker-flow-proxy:latest
hostname: proxy
ports:
- "80:80" # kibana
- "443:443" # kibana https, don't use currently
- "9200:9200" # elasticsearch
- "2020:2020" # fluent-bit (collector) http
- "24224:24224" # fluentd router
- "8200:8200" # apm server
networks:
- overnet
environment:
- LISTENER_ADDRESS=listener
- MODE=swarm
- BIND_PORTS=8200,9200,24224,2020
deploy:
placement:
constraints:
- node.role == manager
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG:-6.5.4}
hostname: "{{.Node.Hostname}}-elasticsearch"
environment:
- MAX_LOCKED_MEMORY=unlimited
- node.name={{.Node.Hostname}}-elasticsearch
- discovery.seed_hosts=elasticsearch
- cluster.name=es_cluster
- cluster.initial_master_nodes=node-3-elasticsearch
- "ES_JAVA_OPTS=-Xms${ES_JVM_HEAP} -Xmx${ES_JVM_HEAP}"
- network.host=0.0.0.0
- xpack.security.enabled=false
- xpack.monitoring.collection.enabled=true
- xpack.license.self_generated.type=trial
networks:
- overnet
volumes:
- elasticsearch:/usr/share/elasticsearch/data
- /sys/fs/cgroup:/sys/fs/cgroup:ro
deploy:
endpoint_mode: dnsrr
placement:
constraints:
- node.labels.backend == true
replicas: 2
resources:
limits:
memory: 8g
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.servicePath=/
- com.df.port=9200
- com.df.srcPort=9200
- com.df.reqMode=http
kibana:
image: docker.elastic.co/kibana/kibana:${TAG:-6.5.4}
hostname: "{{.Node.Hostname}}-kibana"
environment:
- ELASTICSEARCH_HOST=elasticsearch:9200
- SERVER_NAME="{{.Node.Hostname}}-kibana"
networks:
- overnet
volumes:
- kibana:/usr/share/kibana/data
deploy:
placement:
constraints:
- node.labels.frontend == true
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.servicePath=/
- com.df.port=5601
- com.df.srcPort=80
- com.df.reqMode=http
apm_server:
image: docker.elastic.co/apm/apm-server:${TAG:-6.5.4}
environment:
- output.elasticsearch.enabled=true
- output.elasticsearch.hosts=http://elasticsearch:9200
- apm-server.host=0.0.0.0:8200
- apm-server.secret_token=0123456789ABCDEF
- setup.kibana.host=kibana:5601
- setup.template.enabled=true
- logging.to_files=false
networks:
- overnet
depends_on:
- elasticsearch
deploy:
placement:
constraints:
- node.labels.backend == true
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.servicePath=/
- com.df.port=8200
- com.df.srcPort=8200
- com.df.reqMode=http
fluentd:
build: ./config/fluentd
image: ziwon/fluentd-with-plugins
volumes:
- ./config/fluentd:/fluentd/etc
- fluentd-root:/etc/fluentd
- fluentd-buffer:/var/log
networks:
- overnet
depends_on:
- kibana
deploy:
placement:
constraints:
- node.role == manager
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.servicePath=/
- com.df.port=24224
- com.df.srcPort=24224
fluent_bit:
image: fluent/fluent-bit:1.3
volumes:
- ./config/fluentbit:/fluent-bit/etc
- ./log:/var/log
networks:
- overnet
depends_on:
- kibana
deploy:
placement:
constraints:
- node.labels.frontend == true
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.servicePath=/
- com.df.port=2020
- com.df.srcPort=2020
flog:
image: mingrammer/flog
command: "-t log -o /var/log/apache.log -n 1 -s 1 -l"
volumes:
- ./log:/var/log
networks:
- overnet
depends_on:
- kibana
deploy:
placement:
constraints:
- node.labels.frontend == true
networks:
overnet:
external: true
volumes:
elasticsearch:
kibana:
fluentd-root:
fluentd-buffer: