Skip to content

Instantly share code, notes, and snippets.

@kyrcha
Last active August 21, 2018 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyrcha/da95bbbe592a2192dd1b0a519f4ffad2 to your computer and use it in GitHub Desktop.
Save kyrcha/da95bbbe592a2192dd1b0a519f4ffad2 to your computer and use it in GitHub Desktop.
Spin mongodb with mongo express using docker compose

Accessible from the web: http://hostname:8081 through mongo-express and you can connect with a mongodb client like robo 3T in hostname:27017.

To run:

 docker-compose -f mongo.yml up
version: '3.6'
services:
mongo:
image: mongo
container_name: npm-miner-mongo
restart: always
volumes:
- /data/npm-miner/mongodb:/data/db
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: ${ME_CONFIG_MONGODB_ADMINUSERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${ME_CONFIG_MONGODB_ADMINPASSWORD}
mongo-express:
image: mongo-express
container_name: npm-miner-me
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${ME_CONFIG_MONGODB_ADMINUSERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${ME_CONFIG_MONGODB_ADMINPASSWORD}
ME_CONFIG_BASICAUTH_USERNAME: ${ME_CONFIG_BASICAUTH_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_CONFIG_BASICAUTH_PASSWORD}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment