# https://juejin.cn/post/7018489702651002887
version: '3.3'
services:
  mongodb:
    container_name: mongodb
    image: mongo:4.4.14
    restart: always
    ports:
     - 27027:27017
    volumes:
     - ./data/db:/data/db
     - ./data/log:/var/log/mongodb
     - ./data/config:/etc/mongo
    environment:
      - MONGO_INITDB_ROOT_USERNAME=fsdhxfvd
      - MONGO_INITDB_ROOT_PASSWORD=tXopAEkUmyYQnfUetb9b
  mongo-express:
    image: mongo-express:0.54.0
    container_name: mongo-express
    restart: always
    ports:
      - 8091:8081
    environment:
      - ME_CONFIG_MONGODB_ADMINUSERNAME=fsdhxfvd
      - ME_CONFIG_MONGODB_ADMINPASSWORD=tXopAEkUmyYQnfUetb9b
      - ME_CONFIG_MONGODB_SERVER=mongodb
      - ME_CONFIG_MONGODB_PORT=27027

networks:
  default:
    name: mongodb_network