forked from soldotno/elastic-mongo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
142 lines (130 loc) · 3.06 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
version: "3"
services:
mongo3:
hostname: mongo3
image: mongo:3.0.6
entrypoint:
[
"/usr/bin/mongod",
"--replSet",
"rs",
"--journal",
"--smallfiles",
"--rest",
]
ports:
- "27018:27017"
- "28018:28017"
restart: always
mongo2:
hostname: mongo2
image: mongo:3.0.6
entrypoint:
[
"/usr/bin/mongod",
"--replSet",
"rs",
"--journal",
"--smallfiles",
"--rest",
]
ports:
- "27019:27017"
- "28019:28017"
restart: always
mongo1:
hostname: mongo1
image: mongo:3.0.6
entrypoint:
[
"/usr/bin/mongod",
"--replSet",
"rs",
"--journal",
"--smallfiles",
"--rest",
]
ports:
- "27017:27017"
- "28017:28017"
links:
- mongo2:mongo2
- mongo3:mongo3
restart: always
elasticsearch:
hostname: elasticsearch
image: elasticsearch:7.17.4
environment:
- discovery.type=single-node
ports:
- "9200:9200"
- "9300:9300"
links:
- mongo1:mongo1
- mongo2:mongo2
- mongo3:mongo3
volumes:
- ./elasticsearch/logging.yml:/etc/elasticsearch/logging.yml
restart: always
# This configures the MongoDB replicaset
mongosetup:
image: mongo:3.0.6
links:
- mongo1:mongo1
- mongo2:mongo2
- mongo3:mongo3
volumes:
- ./scripts:/scripts
entrypoint: ["/scripts/setup.sh"]
###################################################################
# Make sure you include either mongo-connector OR transporter.
###################################################################
# mongo-connector
# https://github.com/10gen-labs/mongo-connector
connector:
image: python:latest
links:
- mongo1:mongo1
- mongo2:mongo2
- mongo3:mongo3
- elasticsearch:elasticsearch
volumes:
- ./scripts:/scripts
entrypoint: ["/scripts/mongo-connector.sh"]
# Transporter
#
# https://github.com/compose/transporter
# https://www.compose.io/articles/transporter-driving-part-one/
#transporter:
# image: golang:1.18.3
# links:
# - mongo1:mongo1
# - mongo2:mongo2
# - mongo3:mongo3
# - elasticsearch:elasticsearch
# volumes:
# - ./transporter:/transporter
# - ./scripts:/scripts
# entrypoint: ["/transporter/run.sh"]
# restart: "no"
# Make sure ES does not rellocate it's shards when it has low disk space.
disabledisktreshold:
image: mongo:3.0.6
links:
- elasticsearch:elasticsearch
volumes:
- ./scripts:/scripts
entrypoint: ["/scripts/disable-disk-treshold.sh"]
# Verify reading and writing
# Run 'docker logs -f elastic-mongo_verify_1' to see what it outputs.
# That works even though the container has stopped.
verify:
image: mongo:3.0.6
links:
- mongo1:mongo1
- mongo2:mongo2
- mongo3:mongo3
- elasticsearch:elasticsearch
volumes:
- ./scripts:/scripts
entrypoint: ["/scripts/query.sh"]