docker-compose: using multiple Dockerfiles for multiple services

前端 未结 4 1553
陌清茗
陌清茗 2021-02-19 01:37

I\'m using docker-compose and I\'d like to use different Dockerfiles for different services\' build steps. The docs seem to suggest to place different Dockerfiles in different d

4条回答
  •  情书的邮戳
    2021-02-19 02:02

    You have to add it in build section. So, you can specify different alternative dockerfiles for each service.

    services:
      service1:
        build:
            context: .
            args:
                - NODE_ENV=local
            dockerfile: Dockerfile_X
        ports:
            - "8765:8765"
    

提交回复
热议问题