docker-compose.yml
version: "3.8"
services:
mongodb:
image: mongo
restart: unless-stopped
ports:
- 27017:27017
volumes:
- ./database:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=admin
mongo-express:
image: mongo-express
restart: unless-stopped
ports:
- 8081:8081
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=admin
- ME_CONFIG_MONGODB_ADMINPASSWORD=admin
- ME_CONFIG_MONGODB_SERVER=mongodb
networks:
default:
name: mongodb_network