Docker

class logikal_utils.docker.Service(name: str, project: str | None = None, start_timeout_seconds: float = 30, ready_log_text: str | None = None, log_poll_seconds: float = 3)

Manage a project’s Docker Compose services.

Note

Automatically starts all services during initialization whenever necessary based on the compose.yml or compose/local.yml file.

Note

Requires the docker extra.

Parameters:
  • name – The name of the service to manage.

  • project – The name of the project to use.

  • start_timeout_seconds – The time to wait for services to start.

  • ready_log_text – The log text that signals that the service is ready.

  • log_poll_seconds – The time to wait between log text polls while waiting for the service to be ready.

start_services() None

Start all Docker Compose services in the given project.

container_port(service_port: str) str

Return the container host port that is linked to the given service port.