File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -495,11 +495,7 @@ def serve(
495
495
f"Internal Docker error occurred while serving Tesseracts: { ex } "
496
496
) from ex
497
497
498
- if not no_compose :
499
- container_ports = _display_project_meta (project_id )
500
- else :
501
- container = docker_client .containers .get (project_id )
502
- container_ports = [{"name" : container .name , "port" : container .host_port }]
498
+ container_ports = _display_project_meta (project_id )
503
499
logger .info (
504
500
f"Tesseract project ID, use it with 'tesseract teardown' command: { project_id } "
505
501
)
@@ -619,8 +615,13 @@ def _display_project_meta(project_id: str) -> list:
619
615
Returns a list of dictionaries {name: container_name, port: host_port}.
620
616
"""
621
617
container_ports = []
622
- projects = docker_client .compose .list ()
623
- containers = projects [project_id ]
618
+
619
+ compose_projects = docker_client .compose .list ()
620
+ if project_id in compose_projects :
621
+ containers = compose_projects [project_id ]
622
+ else :
623
+ containers = [project_id ]
624
+
624
625
for container_id in containers :
625
626
container = docker_client .containers .get (container_id )
626
627
logger .info (f"Container ID: { container .id } " )
You can’t perform that action at this time.
0 commit comments