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"
Related Contents:
- What is the difference between docker-compose ports vs expose
- What’s the difference between Docker Compose and Kubernetes?
- What is the difference between docker and docker-compose
- Is it safe to clean docker/overlay2/
- How to run docker-compose up -d at system start up?
- How do I make a Docker container start automatically on system boot?
- Docker Compose keep container running
- Where is docker image location in Windows 10?
- Docker – image operating system “windows” cannot be used on this platform
- How to set a path on host for a named volume in docker-compose.yml
- docker-compose, run a script after container has started?
- Access docker container from host using containers name
- How to define build-args in docker-compose?
- Validating docker-compose yml file
- How to override the default value of COMPOSE_HTTP_TIMEOUT with docker-compose command
- Docker-Compose with multiple services
- How to reload environment variables in docker-compose container with minimum downtime?
- Pass argument to docker compose
- How to mount local volumes in docker machine
- Configuring Docker to not use the 172.17.0.0 range
- Docker turn anonymous volume into named volume
- Why the “none” image appears in Docker and how can we avoid it
- DOCKER manifest unknown: manifest unknown
- Using the host ip in docker-compose
- docker-compose for Detached mode
- Kafka in Docker not working
- How can I use environment variables in docker-compose?
- Use docker-compose env variable in Dockerbuild file
- How are Packer and Docker different? Which one should I prefer when provisioning images?
- Dockerfile vs. docker-compose VOLUME
- Difference between ‘image’ and ‘build’ within docker compose
- docker compose override a ports property instead of merging it
- Why is docker-compose failing with ERROR internal load metadata suddenly?
- How to prevent docker-compose building the same image multiple times?
- docker-compose image named: “prefix_%s_1” instead of “%s”
- Using docker-compose to set containers timezones
- Docker-compose exclude service by default
- Can I use mem_limit in docker-compose? and How?
- Docker: where is docker volume located for this compose file
- Docker-compose hangs on Attaching to
- docker-compose – how to escape environment variables
- Docker COPY not updating files when rebuilding container
- Unsupported config option for services.volumes
- Can you define optional docker-compose services?
- Run docker service on HTTPS
- Create networks automatically in Docker Compose
- What’s the docker-compose equivalent of docker run –init?
- Is Docker Compose suitable for production?
- How do I run the same docker-compose.yml several times on same docker daemon with different names?
- How to implement changes made to docker-compose.yml to detached running containers