forked from percona/percona-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
222 lines (222 loc) · 9.03 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
---
version: '3'
services:
standalone:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --port=27017
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s1-mongo1:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S1_RS} --port=${TEST_MONGODB_S1_PRIMARY_PORT} --shardsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s1-mongo2:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S1_RS} --port=${TEST_MONGODB_S1_SECONDARY1_PORT} --shardsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s1-mongo3:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S1_RS} --port=${TEST_MONGODB_S1_SECONDARY2_PORT} --shardsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s2-mongo1:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S2_RS} --port=${TEST_MONGODB_S2_PRIMARY_PORT} --shardsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s2-mongo2:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S2_RS} --port=${TEST_MONGODB_S2_SECONDARY1_PORT} --shardsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s2-mongo3:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S2_RS} --port=${TEST_MONGODB_S2_SECONDARY2_PORT} --shardsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s3-mongo1:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S3_RS} --port=${TEST_MONGODB_S3_PRIMARY_PORT}
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s3-mongo2:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S3_RS} --port=${TEST_MONGODB_S3_SECONDARY1_PORT}
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
s3-mongo3:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_S3_RS} --port=${TEST_MONGODB_S3_SECONDARY2_PORT}
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
configsvr1:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --replSet=${TEST_MONGODB_CONFIGSVR_RS} --port=${TEST_MONGODB_CONFIGSVR1_PORT} --configsvr
volumes:
- ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongod.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
# configsvr2:
# network_mode: host
# image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
# command: --replSet=${TEST_MONGODB_CONFIGSVR_RS} --port=${TEST_MONGODB_CONFIGSVR2_PORT} --configsvr
# volumes:
# - ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
# - ./src/go/docker/test/mongod.key:/mongod.key:ro
# - ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
# - ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
# configsvr3:
# network_mode: host
# image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
# command: --replSet=${TEST_MONGODB_CONFIGSVR_RS} --port=${TEST_MONGODB_CONFIGSVR3_PORT} --configsvr
# volumes:
# - ./src/go/docker/test/entrypoint-mongod.sh:/entrypoint.sh:ro
# - ./src/go/docker/test/mongod.key:/mongod.key:ro
# - ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
# - ./src/go/docker/test/ssl/mongodb.pem:/mongod.pem:ro
mongos:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
command: --port=${TEST_MONGODB_MONGOS_PORT} --configdb=${TEST_MONGODB_CONFIGSVR_RS}/127.0.0.1:${TEST_MONGODB_CONFIGSVR1_PORT}
volumes:
- ./src/go/docker/test/entrypoint-mongos.sh:/entrypoint.sh:ro
- ./src/go/docker/test/entrypoint-mongos.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongos.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/mongodb.pem:/mongos.pem:ro
depends_on:
- configsvr1
# - configsvr2
# - configsvr3
postgres9:
image: ${POSTGRE_IMAGE:-postgres:9.6}
container_name: go_postgres9_1
ports:
- ${POSTGRE_HOST:-127.0.0.1}:${POSTGRE_96_PORT:-6432}:5432
environment:
- POSTGRES_PASSWORD=root
postgres10:
image: ${POSTGRE_IMAGE:-postgres:10.7}
container_name: go_postgres10_1
ports:
- ${POSTGRE_HOST:-127.0.0.1}:${POSTGRE_10_PORT:-6433}:5432
environment:
- POSTGRES_PASSWORD=root
postgres11:
image: ${POSTGRE_IMAGE:-postgres:11}
container_name: go_postgres11_1
ports:
- ${POSTGRE_HOST:-127.0.0.1}:${POSTGRE_11_PORT:-6434}:5432
environment:
- POSTGRES_PASSWORD=root
postgres12:
image: ${POSTGRE_IMAGE:-postgres:12}
container_name: go_postgres12_1
ports:
- ${POSTGRE_HOST:-127.0.0.1}:${POSTGRE_12_PORT:-6435}:5432
environment:
- POSTGRES_PASSWORD=root
init:
network_mode: host
image: ${TEST_MONGODB_FLAVOR}:${TEST_PSMDB_VERSION}
volumes:
- ./src/go/docker/test/init-cluster.sh:/entrypoint.sh:ro
- ./src/go/docker/test/init-cluster.sh:/usr/local/bin/docker-entrypoint.sh:ro
- ./src/go/docker/test/mongod.key:/mongod.key:ro
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/client.pem:/client.pem:ro
env_file:
- .env
depends_on:
- mongos
- s1-mongo1
- s1-mongo2
- s1-mongo3
- s2-mongo1
- s2-mongo2
- s2-mongo3
- s3-mongo1
- s3-mongo2
- s3-mongo3
- standalone
- postgres9
- postgres10
- postgres11
- postgres12
test:
build:
dockerfile: docker/test/Dockerfile
context: .
args:
- GOLANG_DOCKERHUB_TAG=${GOLANG_DOCKERHUB_TAG}
network_mode: host
env_file:
- .env
volumes:
- ./test-out:/tmp/out
- ./src/go/docker/test/ssl/rootCA.crt:/rootCA.crt:ro
- ./src/go/docker/test/ssl/client.pem:/client.pem:ro
depends_on:
- mongos
- s1-mongo1
- s1-mongo2
- s1-mongo3
- s2-mongo1
- s2-mongo2
- s2-mongo3
- init