Connect to MongoDB from Flask-PyMongo

Get started with dockerized MongoDB Get the MongoDB image from here: https://hub.docker.com/_/mongo. Setup the MongoDB container using docker-compose (docker-compose.yaml): version: ‘3.1’ services: mongo: image: mongo:4.0.8-xenial restart: always network_mode: bridge container_name: mongo environment: MONGO_INITDB_DATABASE: admin MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_ROOT_PASSWORD: root ports: – 27017:27017 volumes: – ./mongodbdata:/data/db – ./initdb:/docker-entrypoint-initdb.d mongo-express: image: mongo-express restart: always ports: – 8081:8081 network_mode: […]

Back To Top