Skip to content

Commit eb5d373

Browse files
committed
💄
1 parent 1c9e779 commit eb5d373

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tesseract_core/sdk/cli.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,7 @@ def serve(
495495
f"Internal Docker error occurred while serving Tesseracts: {ex}"
496496
) from ex
497497

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)
503499
logger.info(
504500
f"Tesseract project ID, use it with 'tesseract teardown' command: {project_id}"
505501
)
@@ -619,8 +615,13 @@ def _display_project_meta(project_id: str) -> list:
619615
Returns a list of dictionaries {name: container_name, port: host_port}.
620616
"""
621617
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+
624625
for container_id in containers:
625626
container = docker_client.containers.get(container_id)
626627
logger.info(f"Container ID: {container.id}")

0 commit comments

Comments
 (0)