Method: Docker::Compose::Session#scale

Defined in:
lib/docker/compose/session.rb

#scale(container_count, timeout: 10) ⇒ Object

Idempotently scales the number of containers for given services in the project.

Parameters:

  • container_count (Hash)

    per service, e.g. 2, worker: 3

  • timeout (Integer) (defaults to: 10)

    how long to wait for each service to scale



93
94
95
96
97
# File 'lib/docker/compose/session.rb', line 93

def scale(container_count, timeout: 10)
  args = container_count.map {|service, count| "#{service}=#{count}"}
  o = opts(timeout: [timeout, 10])
  run!('scale', o, *args)
end