Skip to content

Instantly share code, notes, and snippets.

@crazyoptimist
Last active April 9, 2024 23:20
Show Gist options
  • Save crazyoptimist/6b70fba82c5f02347579d825b61894e3 to your computer and use it in GitHub Desktop.
Save crazyoptimist/6b70fba82c5f02347579d825b61894e3 to your computer and use it in GitHub Desktop.
MongoDB Docker Deployment
name: mongodb
services:
mongodb:
container_name: mongo
image: mongo:7
volumes:
- mongodb_data:/data/db/
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: user
MONGO_INITDB_ROOT_PASSWORD: youmayneverguess
command: --quiet
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
restart: always
volumes:
mongodb_data:
@konstantinos2018
Copy link

Thank you

@crazyoptimist
Copy link
Author

Glad it helped :)

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