Skip to content

Instantly share code, notes, and snippets.

@ashblue
Created January 6, 2018 23:31
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ashblue/aa20cd90d2b4609c0b496b66d4153b99 to your computer and use it in GitHub Desktop.
Save ashblue/aa20cd90d2b4609c0b496b66d4153b99 to your computer and use it in GitHub Desktop.
Docker Compose example for MongoDB databases. Includes named volume support.
version: '3'
services:
mongodb:
image: mongo:3.6.1
container_name: uv-mongodb
volumes:
- mongodb:/data/db
- mongodb_config:/data/configdb
ports:
- 27017:27017
command: mongod
volumes:
mongodb:
mongodb_config:
@taksenov
Copy link

taksenov commented Sep 6, 2019

Very useful for me. Tnx!

@thearabbit
Copy link

I base on Mac, Mongo4.x.
I can't find folder mongodb , mongodb _config???

@Mohsenpoureiny
Copy link

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment