protected function startTraefik()
    {
        if ($this->hasTraefik()) {
            $this->createTraefikNetworkProxy();

            if (!$this->isTraefikRunning()) {
                $container = self::TRAEFIK_CONTAINER_NAME;

                if ($this->hasDockerContainer($container)) {
                    $result = $this->taskDockerStart($container)
                        ->run();
                } else {
                    $version = self::TRAEFIK_VERSION;
                    $result = $this->taskDockerRun("traefik:{$version}")
                        ->detached()
                        ->printOutput(false)
                        ->exec('--api --docker')
                        ->name($container)
                        ->option('publish', '80:80')
                        ->option('publish', '8080:8080')
                        ->option('network', self::TRAEFIK_NETWORK)
                        ->volume('/var/run/docker.sock', '/var/run/docker.sock')
                        ->run();
                }

                $this->validateTaskResult($result);
            }
        }

        return $this;
    }
protected function startTraefik()
    {
        if ($this->hasTraefik()) {
            $this->createTraefikNetworkProxy();

            if (!$this->isTraefikRunning()) {
                $container = self::TRAEFIK_CONTAINER_NAME;

                if ($this->hasDockerContainer($container)) {
                    $result = $this->taskDockerStart($container)
                        ->run();
                } else {
                    $version = self::TRAEFIK_VERSION;
                    $result = $this->taskDockerRun("traefik:{$version}")
                        ->detached()
                        ->printOutput(false)
                        ->exec('--api --docker')
                        ->name($container)
                        ->option('publish', '80:80')
                        ->option('publish', '8080:8080')
                        ->option('network', self::TRAEFIK_NETWORK)
                        ->volume('/var/run/docker.sock', '/var/run/docker.sock')
                        ->run();
                }

                $this->validateTaskResult($result);
            }
        }

        return $this;
    }
protected function startTraefik ( ) { if ( $ this -> hasTraefik ( ) ) { $ this -> createTraefikNetworkProxy ( ) ; if ( ! $ this -> isTraefikRunning ( ) ) { $ container = self :: TRAEFIK_CONTAINER_NAME ; if ( $ this -> hasDockerContainer ( $ container ) ) { $ result = $ this -> taskDockerStart ( $ container ) -> run ( ) ; } else { $ version = self :: TRAEFIK_VERSION ; $ result = $ this -> taskDockerRun ( "traefik:{$version}" ) -> detached ( ) -> printOutput ( false ) -> exec ( '--api --docker' ) -> name ( $ container ) -> option ( 'publish' , '80:80' ) -> option ( 'publish' , '8080:8080' ) -> option ( 'network' , self :: TRAEFIK_NETWORK ) -> volume ( '/var/run/docker.sock' , '/var/run/docker.sock' ) -> run ( ) ; } $ this -> validateTaskResult ( $ result ) ; } } return $ this ; }
Start the traefik container if not already running.
Start the traefik container if not already running .