Skip to content

Instantly share code, notes, and snippets.

@deeso
Created September 9, 2020 02:47
Show Gist options
  • Save deeso/643453ffc96147c589de94d794a6130a to your computer and use it in GitHub Desktop.
Save deeso/643453ffc96147c589de94d794a6130a to your computer and use it in GitHub Desktop.
version: '3.1'
services:
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: USERNAME
MONGO_INITDB_ROOT_PASSWORD: PASSWORD
volumes:
- /opt/data/mongo:/data/db
- /opt/data/certificates/mongodb.pem:/data/ssl/mongodb.pem
- /opt/data/certificates/mongodb_ca.crt:/data/ssl/mongodb-cert.crt
ports:
- 27017:27017
command:
--tlsMode=requireTLS
--tlsCertificateKeyFile=/data/ssl/mongodb.pem
--tlsCAFile=/data/ssl/mongodb-cert.crt
--tlsAllowConnectionsWithoutCertificates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment