Created
January 26, 2022 14:59
-
-
Save bharatc9530/b6824cbae45a02a4a721865c74b3c696 to your computer and use it in GitHub Desktop.
docker compose example script
This file contains 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' | |
services: | |
# my-app: | |
# image: ${docker-registry}/my-app:1.0 | |
# ports: | |
# - 3000:3000 | |
mongodb: | |
image: mongo | |
ports: | |
- 27017:27017 | |
environment: | |
- MONGO_INITDB_ROOT_USERNAME=admin | |
- MONGO_INITDB_ROOT_PASSWORD=password | |
volumes: | |
- mongo-data:/data/db | |
mongo-express: | |
image: mongo-express | |
restart: always # fixes MongoNetworkError when mongodb is not ready when mongo-express starts | |
ports: | |
- 8080:8081 | |
environment: | |
- ME_CONFIG_MONGODB_ADMINUSERNAME=admin | |
- ME_CONFIG_MONGODB_ADMINPASSWORD=password | |
- ME_CONFIG_MONGODB_SERVER=mongodb | |
volumes: | |
mongo-data: | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment