1
+ version : " 3.4"
2
+
3
+ services :
4
+
5
+ py-srv :
6
+ build : py-srv
7
+ healthcheck :
8
+ test : " exit 0"
9
+ command : sh -c "/wait && python app.py"
10
+ environment :
11
+ - WAIT_HOSTS=db:26257,es1:9200,es2:9200,es3:9200
12
+ - WAIT_HOSTS_TIMEOUT=300
13
+ - WAIT_SLEEP_INTERVAL=30
14
+ - WAIT_HOST_CONNECT_TIMEOUT=30
15
+ depends_on :
16
+ - db
17
+ - es1
18
+ - es2
19
+ - es3
20
+ links :
21
+ - " db:db"
22
+ - " es1:es1"
23
+ - " es2:es2"
24
+ - " es3:es3"
25
+
26
+
27
+ db :
28
+ image : cockroachdb/cockroach:${COCKROACH_VERSION}
29
+ container_name : db
30
+ ports :
31
+ - " 20000:26257"
32
+ - " 8000:8080"
33
+ command : start --insecure
34
+
35
+ db_1 :
36
+ image : cockroachdb/cockroach:${COCKROACH_VERSION}
37
+ container_name : db_1
38
+ ports :
39
+ - " 20001:26257"
40
+ - " 8001:8080"
41
+ command : start --insecure --join=db
42
+
43
+ db_2 :
44
+ image : cockroachdb/cockroach:${COCKROACH_VERSION}
45
+ container_name : db_2
46
+ ports :
47
+ - " 20002:26257"
48
+ - " 8002:8080"
49
+ command : start --insecure --join=db
50
+
51
+ db-runner :
52
+ image : cockroachdb/cockroach:${COCKROACH_VERSION}
53
+ command :
54
+ - shell
55
+ - /usr/local/bin/init-data.sh
56
+ - db:26257
57
+ volumes :
58
+ - ./db/init-data.sh:/usr/local/bin/init-data.sh:ro
59
+ - ./db/sql:/docker-entrypoint-initdb.d
60
+ depends_on :
61
+ - db
62
+ - db_1
63
+ - db_2
64
+ links :
65
+ - " db:db"
66
+
67
+
68
+ es1 :
69
+ image : elasticsearch:${STACK_VERSION}
70
+ container_name : es1
71
+ hostname : es1
72
+ restart : unless-stopped
73
+ healthcheck :
74
+ test : " exit 0"
75
+ environment :
76
+ - " node.store.allow_mmap=false"
77
+ - " node.name=es1"
78
+ - " bootstrap.memory_lock=true"
79
+ - " cluster.name=es-cluster"
80
+ - " discovery.seed_hosts=es2,es3"
81
+ - " cluster.initial_master_nodes=es1,es2,es3"
82
+ - " ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.index.number_of_replicas=0"
83
+ - " xpack.security.enabled=false"
84
+ - " xpack.security.http.ssl.enabled=false"
85
+ - " xpack.security.transport.ssl.enabled=false"
86
+ - " xpack.ml.enabled=false"
87
+ - " xpack.graph.enabled=false"
88
+ - " xpack.watcher.enabled=false"
89
+ ulimits :
90
+ memlock :
91
+ soft : -1
92
+ hard : -1
93
+ ports :
94
+ - 9200:9200
95
+ # volumes:
96
+ # - ./es/es1/data:/usr/share/elasticsearch/data
97
+ # - ./es/es1/log:/usr/share/elasticsearch/log
98
+
99
+ es2 :
100
+ image : elasticsearch:${STACK_VERSION}
101
+ container_name : es2
102
+ hostname : es2
103
+ restart : unless-stopped
104
+ healthcheck :
105
+ test : " exit 0"
106
+ environment :
107
+ - " node.store.allow_mmap=false"
108
+ - " node.name=es2"
109
+ - " bootstrap.memory_lock=true"
110
+ - " cluster.name=es-cluster"
111
+ - " discovery.seed_hosts=es3,es1"
112
+ - " cluster.initial_master_nodes=es1,es2,es3"
113
+ - " ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.index.number_of_replicas=0"
114
+ - " xpack.security.enabled=false"
115
+ - " xpack.security.http.ssl.enabled=false"
116
+ - " xpack.security.transport.ssl.enabled=false"
117
+ - " xpack.ml.enabled=false"
118
+ - " xpack.graph.enabled=false"
119
+ - " xpack.watcher.enabled=false"
120
+ ulimits :
121
+ memlock :
122
+ soft : -1
123
+ hard : -1
124
+ ports :
125
+ - 9201:9200
126
+ # volumes:
127
+ # - ./es/es2/data:/usr/share/elasticsearch/data
128
+ # - ./es/es2/log:/usr/share/elasticsearch/log
129
+
130
+ es3 :
131
+ image : elasticsearch:${STACK_VERSION}
132
+ container_name : es3
133
+ hostname : es3
134
+ restart : unless-stopped
135
+ healthcheck :
136
+ test : " exit 0"
137
+ environment :
138
+ - " node.store.allow_mmap=false"
139
+ - " node.name=es3"
140
+ - " bootstrap.memory_lock=true"
141
+ - " cluster.name=es-cluster"
142
+ - " discovery.seed_hosts=es2,es1"
143
+ - " cluster.initial_master_nodes=es1,es2,es3"
144
+ - " ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.index.number_of_replicas=0"
145
+ - " xpack.security.enabled=false"
146
+ - " xpack.security.http.ssl.enabled=false"
147
+ - " xpack.security.transport.ssl.enabled=false"
148
+ - " xpack.ml.enabled=false"
149
+ - " xpack.graph.enabled=false"
150
+ - " xpack.watcher.enabled=false"
151
+ ulimits :
152
+ memlock :
153
+ soft : -1
154
+ hard : -1
155
+ ports :
156
+ - 9202:9200
157
+ # volumes:
158
+ # - ./es/es3/data:/usr/share/elasticsearch/data
159
+ # - ./es/es3/log:/usr/share/elasticsearch/log
160
+
161
+ kibana :
162
+ image : kibana:${STACK_VERSION}
163
+ healthcheck :
164
+ test : " exit 0"
165
+ environment :
166
+ - " ELASTICSEARCH_HOSTS=http://es1:9200"
167
+ - " SERVER_NAME=127.0.0.1"
168
+ ports :
169
+ - 5601:5601
170
+ depends_on :
171
+ - es1
172
+ - es2
173
+ - es3
0 commit comments