@@ -222,12 +222,13 @@ def cli_node_files(name, environment, system_folders):
222222@click .option ('-i' , '--image' , default = None , help = "Node Docker image to use" )
223223@click .option ('--keep/--auto-remove' , default = False ,
224224 help = "Keep image after finishing" )
225- @click .option ('--attach/--detach' , default = False ,
226- help = "Attach node logs to the console after start" )
227225@click .option ('--mount-src' , default = '' ,
228226 help = "mount vantage6-master package source" )
227+ @click .option ('--attach/--detach' , default = False ,
228+ help = "Attach node logs to the console after start" )
229+ @click .option ('-p' , '--port' , default = 5050 , help = "api forwarder port" )
229230def cli_node_start (name , config , environment , system_folders , image , keep ,
230- mount_src , attach ):
231+ mount_src , attach , port ):
231232 """Start the node instance.
232233
233234 If no name or config is specified the default.yaml configuation is
@@ -376,7 +377,7 @@ def cli_node_start(name, config, environment, system_folders, image, keep,
376377 # debug(f" with command: '{cmd}'")
377378 # debug(f" with mounts: {volumes}")
378379 # debug(f" with environment: {env}")
379-
380+ api_forwarder_port = ctx . config . get ( 'api_forwarder_port' , 5555 )
380381 container = docker_client .containers .run (
381382 image ,
382383 command = cmd ,
@@ -388,8 +389,9 @@ def cli_node_start(name, config, environment, system_folders, image, keep,
388389 "name" : ctx .config_file_name
389390 },
390391 environment = env ,
392+ ports = {f"{ api_forwarder_port } /tcp" : ("0.0.0.0" , port )},
391393 name = ctx .docker_container_name ,
392- auto_remove = not keep ,
394+ auto_remove = ( not keep ) ,
393395 tty = True
394396 )
395397
0 commit comments