Skip to content

Instantly share code, notes, and snippets.

@ryder247
Forked from ScriptBytes/docker-compose.yml
Created August 2, 2024 00:23
Show Gist options
  • Select an option

  • Save ryder247/f0887913a57d4ccef6e04030b4afb39b to your computer and use it in GitHub Desktop.

Select an option

Save ryder247/f0887913a57d4ccef6e04030b4afb39b 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
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
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