Skip to content

Instantly share code, notes, and snippets.

@sasankaweera123
Created July 26, 2023 04:30
Show Gist options
  • Save sasankaweera123/5ebf37dd6689d148861a19f947c4c3ba to your computer and use it in GitHub Desktop.
Save sasankaweera123/5ebf37dd6689d148861a19f947c4c3ba to your computer and use it in GitHub Desktop.
Docker container Creation for MongoDB
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