Created
July 26, 2023 04:30
-
-
Save sasankaweera123/5ebf37dd6689d148861a19f947c4c3ba to your computer and use it in GitHub Desktop.
Docker container Creation for MongoDB
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: | |
mongodb: | |
image: mongo | |
container_name: mongodb | |
ports: | |
- 27017:27017 | |
volumes: | |
- data:/data | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: rootuser | |
MONGO_INITDB_ROOT_PASSWORD: rotpass | |
mongo-express: | |
image: mongo-express | |
container_name: mongo-express | |
ports: | |
- 8081:8081 | |
environment: | |
ME_CONFIG_MONGODB_ADMINUSERNAME: rootuser | |
ME_CONFIG_MONGODB_ADMINPASSWORD: rotpass | |
ME_CONFIG_MONGODB_SERVER: mongodb | |
volumes: | |
data: {} | |
networks: | |
default: | |
name: mongo-network |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment