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

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

    The simplest way is run docker-compose up -d in directory with docker-compose.yml:

    version: "3"
    services:
      mongo:
        image: "mongo:3-stretch"
      mongo-express:
        image: "mongo-express:latest"
        ports:
          - "8081:8081"
    

    And then open http://localhost:8081/ in your browser.

提交回复
热议问题