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

前端 未结 8 2100
情话喂你
情话喂你 2021-02-14 07:10

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

version: \'3\'

services:
    mongo:
        image: mongo
        environment:
         


        
8条回答
  •  暖寄归人
    2021-02-14 08:14

    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!

提交回复
热议问题