Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example mongodb docker setup
version: "2"
services:
mongo:
image: mckernanin/mongo-auth:4.0.8
environment:
AUTH: "yes"
MONGODB_ADMIN_USER: admin
MONGODB_ADMIN_PASS: '**********' # set your admin password here
MONGODB_APPLICATION_DATABASE: appname # give the db a name
MONGODB_APPLICATION_USER: application
MONGODB_APPLICATION_PASS: '**********' # set your application password here
ports:
- 27017:27017
volumes:
- ~/.mongo:/data/db # this persists your mongo data to disk outside of docker
# mongo-backup: # automated backups to s3
# image: lgatica/mongodump-s3
# environment:
# MONGO_URI: mongodb://application:**********@mongodb/appname # connection string based on above config
# AWS_ACCESS_KEY_ID: '**********' # aws access key
# AWS_SECRET_ACCESS_KEY: '**********' # aws secret key
# AWS_DEFAULT_REGION: us-east-2 # aws region
# S3_BUCKET: '**********' # aws bucket name
# BACKUP_CRON_SCHEDULE: 0 2 * * *
# S3_PATH: '**********' # aws bucket path
# links:
# - mongo:mongodb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.