Last active
February 12, 2025 15:58
-
-
Save ScriptBytes/2c0b8658fe6e16467f697f76be06f7bd to your computer and use it in GitHub Desktop.
Docker compose file and example docker run command for my youtube video: https://youtu.be/gFjpv-nZO0U
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
mongo: | |
image: mongo:7.0 | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: mongadmin | |
MONGO_INITDB_ROOT_PASSWORD: LikeAndSubscribe | |
ports: | |
- 27017:27017 | |
volumes: | |
- mongodata:/data/db | |
volumes: | |
mongodata: | |
driver: local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d \ | |
--name mongo-demo \ | |
-e MONGO_INITDB_ROOT_USERNAME=mongoadmin \ | |
-e MONGO_INITDB_ROOT_PASSWORD=LikeAndSubscribe \ | |
-p 27017:27017 \ | |
-v mongodemo:/data/db \ | |
mongo:7.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment