forked from percona/mongodb_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
41 lines (41 loc) · 1.28 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
# see CONTRIBUTING.md
---
version: '3'
services:
mongo:
image: ${MONGODB_IMAGE:-mongo:3.6}
ports:
- 127.0.0.1:27017:27017
# Given a signed SSL certificate located at /etc/ssl/server.pem
# and the certificate authority file at /etc/ssl/ca.crt,
# you can configure mongod for SSL encryption as follows:
# ```
# mongod \
# --sslMode requireSSL \
# --sslPEMKeyFile /etc/ssl/server.pem \
# --sslCAFile /etc/ssl/ca.crt
# ```
# https://docs.mongodb.com/manual/tutorial/configure-ssl/#set-up-mongod-and-mongos-with-certificate-validation
command:
- --sslMode=preferSSL
- --sslPEMKeyFile=/etc/ssl/server.pem
- --sslCAFile=/etc/ssl/ca.crt
- --bind_ip=0.0.0.0
volumes:
- ./testdata/ca.crt:/etc/ssl/ca.crt
- ./testdata/server.pem:/etc/ssl/server.pem
- ./testdata/client.pem:/etc/ssl/client.pem
mongo-replset:
image: ${MONGODB_IMAGE:-mongo:3.6}
ports:
- 127.0.0.1:27019:27017
command:
- --bind_ip=0.0.0.0
- --replSet=rs0
- --sslMode=preferSSL
- --sslPEMKeyFile=/etc/ssl/server.pem
- --sslCAFile=/etc/ssl/ca.crt
volumes:
- ./testdata/ca.crt:/etc/ssl/ca.crt
- ./testdata/server.pem:/etc/ssl/server.pem
- ./testdata/client.pem:/etc/ssl/client.pem