Skip to content

Instantly share code, notes, and snippets.

@davidcsejtei
Created June 4, 2025 07:27
Show Gist options
  • Save davidcsejtei/15256739afecb91cfc7b818ce5472e46 to your computer and use it in GitHub Desktop.
Save davidcsejtei/15256739afecb91cfc7b818ce5472e46 to your computer and use it in GitHub Desktop.
MongoDB + MongoExpress docker compose
version: '3.8'
services:
mongo:
image: mongo:7
container_name: mongodb
restart: always
ports:
- '27017:27017'
volumes:
- ./mongo-data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
mongo-express:
image: mongo-express
container_name: mongo-express
restart: always
ports:
- '8081:8081'
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
ME_CONFIG_MONGODB_SERVER: mongo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment