forked from elastic/stack-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
149 lines (144 loc) · 5.59 KB
/
docker-compose.yml
File metadata and controls
149 lines (144 loc) · 5.59 KB
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
---
version: '3.6'
services:
# The environment variable "TAG" is used throughout this file to
# specify the version of the images to run. The default is set in the
# '.env' file in this folder. It can be overridden with any normal
# technique for setting environment variables, for example:
#
# TAG=6.0.0-beta1 docker-compose up
#
# REF: https://docs.docker.com/compose/compose-file/#variable-substitution
#
# Also be sure to set the ELASTIC_VERSION variable. For released versions,
# ${TAG} and ${ELASTIC_VERSION} will be identical, but for pre-release
# versions, ${TAG} might contain an extra build identifier, like
# "6.0.0-beta1-3eab5b40", so a full invocation might look like:
#
# ELASTIC_VERSION=6.0.0-beta1 TAG=6.0.0-beta1-3eab5b40 docker-compose up
#
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
container_name: elasticsearch
environment:
- node.name=es1
secrets:
- source: ca.crt
target: /usr/share/elasticsearch/config/certs/ca/ca.crt
- source: elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
- source: elasticsearch.keystore
target: /usr/share/elasticsearch/config/elasticsearch.keystore
- source: elasticsearch.key
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.key
- source: elasticsearch.crt
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.crt
ports: ['9200:9200']
networks: ['stack']
volumes:
- 'es_data:/usr/share/elasticsearch/data'
- './scripts/setup-users.sh:/usr/local/bin/setup-users.sh:ro'
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certs/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
container_name: elasticsearch2
environment:
- node.name=es2
secrets:
- source: ca.crt
target: /usr/share/elasticsearch/config/certs/ca/ca.crt
- source: elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
- source: elasticsearch.keystore
target: /usr/share/elasticsearch/config/elasticsearch.keystore
- source: elasticsearch.key
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.key
- source: elasticsearch.crt
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.crt
ports: ['9201:9200']
networks: ['stack']
volumes:
- 'es_data2:/usr/share/elasticsearch/data'
- './scripts/setup-users.sh:/usr/local/bin/setup-users.sh:ro'
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certs/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
elasticsearch3:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
container_name: elasticsearch3
secrets:
- source: ca.crt
target: /usr/share/elasticsearch/config/certs/ca/ca.crt
- source: elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
- source: elasticsearch.keystore
target: /usr/share/elasticsearch/config/elasticsearch.keystore
- source: elasticsearch.key
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.key
- source: elasticsearch.crt
target: /usr/share/elasticsearch/config/certs/elasticsearch/elasticsearch.crt
ports: ['9202:9200']
networks: ['stack']
volumes:
- 'es_data3:/usr/share/elasticsearch/data'
- './scripts/setup-users.sh:/usr/local/bin/setup-users.sh:ro'
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certs/ca/ca.crt -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
kibana:
image: docker.elastic.co/kibana/kibana:${TAG}
container_name: kibana
secrets:
- source: kibana.yml
target: /usr/share/kibana/config/kibana.yml
- source: kibana.keystore
target: /usr/share/kibana/data/kibana.keystore
- source: ca.crt
target: /usr/share/kibana/config/certs/ca/ca.crt
- source: kibana.key
target: /usr/share/kibana/config/certs/kibana/kibana.key
- source: kibana.crt
target: /usr/share/kibana/config/certs/kibana/kibana.crt
ports: ['5601:5601']
networks: ['stack']
depends_on: ['elasticsearch']
healthcheck:
test: curl --cacert /usr/share/elasticsearch/config/certs/ca/ca.crt -s https://localhost:5601 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
interval: 30s
timeout: 10s
retries: 5
networks: {stack: {}}
# use docker volume to persist ES data outside of a container.
volumes:
es_data:
es_data2:
es_data3:
secrets:
ca.crt:
file: ./config/ssl/ca/ca.crt
elasticsearch.yml:
file: ./config/elasticsearch/elasticsearch.yml
elasticsearch.keystore:
file: ./config/elasticsearch/elasticsearch.keystore
elasticsearch.key:
file: ./config/elasticsearch/elasticsearch.key
elasticsearch.crt:
file: ./config/elasticsearch/elasticsearch.crt
elasticsearch.p12:
file: ./config/elasticsearch/elasticsearch.p12
kibana.yml:
file: ./config/kibana/kibana.yml
kibana.keystore:
file: ./config/kibana/kibana.keystore
kibana.key:
file: ./config/kibana/kibana.key
kibana.crt:
file: ./config/kibana/kibana.crt