新建简单的docker-compose.yml文件 hello-world

    1. version: '3.1'
    2. services:
    3. hello-world:
    4. image: hello-world

    使用命令可后台运行 docker-compose up -d
    使用 docker-compose构建mongdb和mongodb-express

    1. # docker-compose.yml
    2. version: '3.1'
    3. services:
    4. mongo:
    5. image: mongo
    6. restart: always
    7. ports:
    8. - 27017:27017
    9. mongo-express:
    10. image: mongo-express
    11. restart: always
    12. ports:
    13. - 8000:8081