@@ -134,6 +134,7 @@ def run_docker_serve(
134
134
config_name : Optional [str ] = None ,
135
135
config_path : Optional [str ] = None ,
136
136
exclude_postgres : bool = False ,
137
+ scale : Optional [int ] = None ,
137
138
):
138
139
check_docker_compose_version ()
139
140
check_set_docker_env_vars (project_name , exclude_postgres )
@@ -160,6 +161,7 @@ def run_docker_serve(
160
161
config_name ,
161
162
config_path ,
162
163
exclude_postgres ,
164
+ scale ,
163
165
)
164
166
165
167
click .secho ("R2R now runs on port 7272 by default!" , fg = "yellow" )
@@ -321,6 +323,9 @@ def get_compose_files():
321
323
compose_files = {
322
324
"base" : os .path .join (package_dir , "compose.yaml" ),
323
325
"full" : os .path .join (package_dir , "compose.full.yaml" ),
326
+ "full_scale" : os .path .join (
327
+ package_dir , "compose.full_with_replicas.yaml"
328
+ ),
324
329
}
325
330
326
331
for name , path in compose_files .items ():
@@ -357,13 +362,18 @@ def build_docker_command(
357
362
image ,
358
363
config_name ,
359
364
config_path ,
360
- exclude_postgres : bool = False ,
365
+ exclude_postgres ,
366
+ scale ,
361
367
):
362
368
if not full :
363
369
base_command = f"docker compose -f { compose_files ['base' ]} "
364
370
else :
365
- base_command = f"docker compose -f { compose_files ['full' ]} "
371
+ if not scale :
372
+ base_command = f"docker compose -f { compose_files ['full' ]} "
373
+ else :
374
+ base_command = f"docker compose -f { compose_files ['full_scale' ]} "
366
375
376
+ print ("base_command = " , base_command )
367
377
base_command += (
368
378
f" --project-name { project_name or ('r2r-full' if full else 'r2r' )} "
369
379
)
@@ -388,6 +398,8 @@ def build_docker_command(
388
398
if not exclude_postgres :
389
399
pull_command = f"{ base_command } --profile postgres pull"
390
400
up_command = f"{ base_command } --profile postgres up -d"
401
+ if scale :
402
+ up_command += f" --scale r2r={ scale } "
391
403
else :
392
404
pull_command = f"{ base_command } pull"
393
405
up_command = f"{ base_command } up -d"
0 commit comments