Docker - Scale (Number of container for a service)

Card Puncher Data Processing


Scale sets the number of containers to run for a service.


Command line

# Use the up command with the --scale flag instead. - Scale SERVICE to NUM instances.
# docker-compose up --scale SERVICE=NUM        
docker-compose up --scale web=2 worker=3
# deprecated
docker-compose scale web=2 worker=3

It will overrides the scale setting in the Compose file if present.


Added in version 2.2 file format. Version 2

  image: busybox:latest
  command: echo 'scaled'
  scale: 3

Documentation / Reference

Share this page:
Follow us:
Task Runner