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)
|
logger.info("Successfully built image %s for instance %s", image_tag, instance_name)
|
||||||
|
|
||||||
# Generate compose for dockerfile-built image
|
# 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"
|
compose_content = f"""version: "3.8"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: {image_tag}
|
image: {image_tag}
|
||||||
container_name: {instance_name.lower()}
|
container_name: {instance_name.lower()}
|
||||||
ports:
|
{ports_section} volumes:
|
||||||
- "{tool_port}:{tool_type.default_port}"
|
|
||||||
volumes:
|
|
||||||
- {repo_path}:/workspace
|
- {repo_path}:/workspace
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user