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

前端 未结 8 2120
情话喂你
情话喂你 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:12

    This is very useful things but same time unstable. You need find out your own way How to write docker-compose.yml For me It's was works something like that

    version: '3'
    services:
      db:
        image: mongo:2.6.12
        container_name: app_db
        volumes:
          - store:/data/db
        ports:
          - "27017:27017"
      mongo-express:
        container_name: mongo-express
        links:
          - 'db:mongo'
        ports:
          - '8081:8081'
        environment:
          - 'ME_CONFIG_OPTIONS_EDITORTHEME=ambiance'
          - 'ME_CONFIG_BASICAUTH_USERNAME=user'
          - 'ME_CONFIG_BASICAUTH_PASSWORD=pass'
        image: mongo-express 
    

提交回复
热议问题