Skip to content

Instantly share code, notes, and snippets.

@jsheridanwells
Created February 19, 2021 15:28
Show Gist options
  • Save jsheridanwells/00133b4a52c82fd4d4031bb4d3c306e7 to your computer and use it in GitHub Desktop.
Save jsheridanwells/00133b4a52c82fd4d4031bb4d3c306e7 to your computer and use it in GitHub Desktop.
Docker Compose for running MongoDB on localhost
version: "3"
services:
mongodb:
container_name: mean_urls_db
image: mongo:latest
volumes:
- ./scripts/mongo/init/:/docker-entrypoint-initdb.d
- ./scripts/mongo/init:/home/mongodb
- ./scripts/mongo/seed/:/home/mongodb/seed
- mean_urls_data:/data/db
ports:
- "28017:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_INITDB_ROOT_PASSWORD
- APP_USER=$APP_USER
- APP_PWD=$APP_PWD
- DB_NAME=$DB_NAME
- DB_COLLECTION_NAME=$DB_COLLECTION_NAME
- MONGO_HOSTNAME=$MONGO_HOSTNAME
volumes:
mean_urls_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment