Skip to main content

setup_and_start

Function setup_and_start 

Source
pub async fn setup_and_start(
    client: &DockerClient,
    opencode_web_port: Option<u16>,
    env_vars: Option<Vec<String>>,
    bind_address: Option<&str>,
    cockpit_port: Option<u16>,
    cockpit_enabled: Option<bool>,
) -> Result<String, DockerError>
Expand description

Full setup: ensure volumes exist, create container if needed, start it

This is the primary entry point for starting the opencode service. Returns the container ID on success.

§Arguments

  • client - Docker client
  • opencode_web_port - Port to bind on host for opencode web UI (defaults to OPENCODE_WEB_PORT)
  • env_vars - Additional environment variables (optional)
  • bind_address - IP address to bind on host (defaults to “127.0.0.1”)
  • cockpit_port - Port to bind on host for Cockpit (defaults to 9090)
  • cockpit_enabled - Whether to enable Cockpit port mapping (defaults to true)