How to run MongoDB and Mongo-express with docker-compose?

前端 未结 3 1953
Happy的楠姐
Happy的楠姐 2021-02-14 07:30

I try to run MongoDB and Mongo-express by Docker-compose. I use following config:

version: \'3\'

services:
    mongo:
        image: mongo
        environment:
         


        
3条回答
  •  长情又很酷
    2021-02-14 08:08

    Running it like this just worked for me maybe it helps you

          mongoex:
            image: mongo-express
            environment:
            - ME_CONFIG_OPTIONS_EDITORTHEME=ambiance
            - ME_CONFIG_MONGODB_SERVER=database
            - ME_CONFIG_MONGODB_PORT=27017
            - ME_CONFIG_MONGODB_ENABLE_ADMIN=false
            - ME_CONFIG_MONGODB_AUTH_DATABASE=admin
            ports:
            - "8081:8081"
            links:
            - database
          database:
            image: mongo:latest
            command: --smallfiles
            ports:
              - "27017:27017"
    

    good luck and regards!

提交回复
热议问题