fix: skip port mapping for terminal-only tools in dockerfile compose
This commit is contained in:
@@ -606,14 +606,17 @@ async def create_instance(
|
||||
logger.info("Successfully built image %s for instance %s", image_tag, instance_name)
|
||||
|
||||
# Generate compose for dockerfile-built image
|
||||
# Only include ports if tool requires one (skip for terminal-only tools)
|
||||
ports_section = f""" ports:
|
||||
- "{tool_port}:{tool_type.default_port}"
|
||||
""" if tool_type.default_port and tool_type.default_port > 0 else ""
|
||||
|
||||
compose_content = f"""version: "3.8"
|
||||
services:
|
||||
app:
|
||||
image: {image_tag}
|
||||
container_name: {instance_name.lower()}
|
||||
ports:
|
||||
- "{tool_port}:{tool_type.default_port}"
|
||||
volumes:
|
||||
{ports_section} volumes:
|
||||
- {repo_path}:/workspace
|
||||
restart: unless-stopped
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user