Commonly used Docker Compose Files
Below is a list of commonly used Docker compose files for getting started quickly in development.
MongoDB
MongoDB is widely used NoSql database. We use it often in out projects, docker is the most convenient solution.
Only MongoDB
We can use MongoDB docker image directly and connect to application and use MongoDB Compass for database client.
version: "3.8"services: mongodb: image: mongo ports: - "27017:27017" volumes: - mongo_db_data:/data/db environment: MONGODB_DATABASE: dbvolumes: mongo_db_data:With Mongo Express
If you don’t want to install MongoDB Compass in your system, then another great alternative is the web based Mongo Express docker image.
version: "3.8"
services: mongo: image: mongo ports: - 27017:27017
mongo-express: image: mongo-express ports: - 8081:8081 environment: ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/ ME_CONFIG_BASICAUTH_USERNAME: test ME_CONFIG_BASICAUTH_PASSWORD: test