Skip to content

Instantly share code, notes, and snippets.

@dyarfi
Last active March 31, 2022 18:34
Show Gist options
  • Save dyarfi/314e1bc71101c5c3fdd440e43d8ea3fe to your computer and use it in GitHub Desktop.
Save dyarfi/314e1bc71101c5c3fdd440e43d8ea3fe to your computer and use it in GitHub Desktop.
Docker Compose to open MongoDB container to open MongoDB server from localhost using Robo 3T.
version: "3.8"
services:
mongodb:
image: mongo
container_name: mongodb
restart: always
ports:
- 27018:27017
volumes:
- ./data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=user
- MONGO_INITDB_ROOT_PASSWORD=pass
expose:
- 27018
command: --quiet
mongo-express:
image: mongo-express
container_name: mongo-express
restart: always
ports:
- 8081:8081
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=user
- ME_CONFIG_MONGODB_ADMINPASSWORD=pass
- ME_CONFIG_MONGODB_SERVER=mongodb
networks:
default:
name: mongodb_network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment