Skip to content

Instantly share code, notes, and snippets.

@JamesReate
Created April 10, 2020 17:42
Show Gist options
  • Save JamesReate/36ae3ac5bea170b84496350a36cdd387 to your computer and use it in GitHub Desktop.
Save JamesReate/36ae3ac5bea170b84496350a36cdd387 to your computer and use it in GitHub Desktop.
Mongodb docker compose
version: "3.7"
services:
database:
image: "mongo:latest"
container_name: "database"
environment:
- MONGO_INITDB_DATABASE=catalog
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=root
volumes:
- ./mongo/init.js:/docker-entrypoint-initdb.d/init-mongo-js:ro
- ./mongo/volume:/data/db
ports:
- '27017-27019:27017-27019'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment