6104f592eb
Split monolithic docker.py into focused modules: - docker/compose.py — compose generation, execute_compose_command, volume sorting - docker/container.py — container status, IP, logs, network, port finding - docker/config_staging.py — instance dir, env file, config file staging - docker/tunnel.py — cloudflared tunnel lifecycle (moved from services/tunnel.py) - docker/__init__.py — re-exports all public symbols for backward compatibility - services/tunnel.py — thin re-export wrapper for backward compatibility Also includes schema extraction files created in prior work: - schemas/config/config_profile.py - schemas/project/*.py - schemas/system/health.py - schemas/tool/*.py - schemas/user/*.py All existing imports like 'from src.services.docker import X' and 'from src.services.tunnel import X' continue to work unchanged. Quality gates: py_compile passed, ruff passed, import test passed.
56 lines
1.4 KiB
Python
56 lines
1.4 KiB
Python
"""Docker services package for container and compose operations."""
|
|
|
|
from src.services.docker.compose import (
|
|
execute_compose_command,
|
|
render_compose_template,
|
|
sort_volumes_by_specificity,
|
|
write_compose_file,
|
|
)
|
|
from src.services.docker.config_staging import (
|
|
ensure_instance_directory,
|
|
write_config_files,
|
|
write_env_file,
|
|
)
|
|
from src.services.docker.container import (
|
|
connect_container_to_network,
|
|
find_free_port,
|
|
get_backend_network_name,
|
|
get_container_id,
|
|
get_container_ip_on_network,
|
|
get_container_logs,
|
|
get_container_name,
|
|
get_container_status,
|
|
is_container_on_network,
|
|
wait_for_container_running,
|
|
)
|
|
from src.services.docker.tunnel import (
|
|
check_tunnel_health,
|
|
recreate_tunnel,
|
|
start_tunnel,
|
|
stop_tunnel,
|
|
)
|
|
|
|
__all__ = [
|
|
"check_tunnel_health",
|
|
"connect_container_to_network",
|
|
"ensure_instance_directory",
|
|
"execute_compose_command",
|
|
"find_free_port",
|
|
"get_backend_network_name",
|
|
"get_container_id",
|
|
"get_container_ip_on_network",
|
|
"get_container_logs",
|
|
"get_container_name",
|
|
"get_container_status",
|
|
"is_container_on_network",
|
|
"recreate_tunnel",
|
|
"render_compose_template",
|
|
"sort_volumes_by_specificity",
|
|
"start_tunnel",
|
|
"stop_tunnel",
|
|
"wait_for_container_running",
|
|
"write_compose_file",
|
|
"write_config_files",
|
|
"write_env_file",
|
|
]
|