Skip to content

Instantly share code, notes, and snippets.

@tury3001
Created June 28, 2023 12:09
Show Gist options
  • Save tury3001/5d275a2260f0aeaa51c983698e7b25f2 to your computer and use it in GitHub Desktop.
Save tury3001/5d275a2260f0aeaa51c983698e7b25f2 to your computer and use it in GitHub Desktop.
Basic Mongo container for Docker
MONGO_PORT=27017
MONGO_ROOT_USERNAME=someuser
MONGO_ROOT_PASSWORD=somepassword
{
mongo:
image: mongo:latest
restart: always
env_file: ./.env
ports:
- $MONGO_PORT:$MONGO_PORT
environment:
MONGO_INITDB_ROOT_USERNAME: $MONGO_ROOT_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $MONGO_ROOT_PASSWORD
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment