|
@@ -372,8 +372,14 @@ class TopLevelCommand(Command):
|
|
|
|
|
|
$ docker-compose scale web=2 worker=3
|
|
|
|
|
|
- Usage: scale [SERVICE=NUM...]
|
|
|
+ Usage: scale [options] [SERVICE=NUM...]
|
|
|
+
|
|
|
+ Options:
|
|
|
+ -t, --timeout TIMEOUT Specify a shutdown timeout in seconds.
|
|
|
+ (default: 10)
|
|
|
"""
|
|
|
+ timeout = int(options.get('--timeout') or DEFAULT_TIMEOUT)
|
|
|
+
|
|
|
for s in options['SERVICE=NUM']:
|
|
|
if '=' not in s:
|
|
|
raise UserError('Arguments to scale should be in the form service=num')
|
|
@@ -383,7 +389,7 @@ class TopLevelCommand(Command):
|
|
|
except ValueError:
|
|
|
raise UserError('Number of containers for service "%s" is not a '
|
|
|
'number' % service_name)
|
|
|
- project.get_service(service_name).scale(num)
|
|
|
+ project.get_service(service_name).scale(num, timeout=timeout)
|
|
|
|
|
|
def start(self, project, options):
|
|
|
"""
|