docker-compose 安装 MongoDB和mongo-express可视化

发布时间:2021-11-14作者:laosun阅读(1331)

docker-compose

docker-compose 安装 MongoDB和mongo-express可视化

    docker-compose.yaml

    version: '3.9'
    networks:
      mongo-network:
        external: false
    services:
      mongo:
        image: mongo:latest
        networks:
          - mongo-network
        container_name: mongo
        restart: always
        ports:
         - 27017:27017
        environment:
          MONGO_INITDB_ROOT_USERNAME: root
          MONGO_INITDB_ROOT_PASSWORD: root
          
      mongo-express:
        image: mongo-express
        restart: always
        ports:
          - 8081:8081
        environment:
          ME_CONFIG_MONGODB_ADMINUSERNAME: root
          ME_CONFIG_MONGODB_ADMINPASSWORD: root
          ME_CONFIG_MONGODB_URL: mongodb://root:root@mongo:27017/
        depends_on:
          - mongo
        networks:
          - mongo-network

    Image

    Image


0 +1

版权声明

 请文明留言

0 条评论