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

前端 未结 3 2046
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:03

    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.

提交回复
热议问题