docker-compose: using multiple Dockerfiles for multiple services

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"

Leave a Comment