namespace CaddyManager.Contracts.Configurations.Docker;
///
/// Configuration for the Docker service
///
public class DockerServiceConfiguration
{
public const string Docker = "Docker";
///
/// Name of the Caddy container to be controlled (i.e restart)
///
public string CaddyContainerName { get; set; } = "caddy";
///
/// Uri to the Docker host
///
public string DockerHost { get; set; } = "unix:///var/run/docker.sock";
///
/// Returns the Docker host with environment check. If the environment variable DOCKER_HOST is set, it will return
/// that value, otherwise it will return the value of DockerHost
///
public string DockerHostWithEnvCheck
{
get
{
var envValue = Environment.GetEnvironmentVariable("DOCKER_HOST");
return string.IsNullOrWhiteSpace(envValue) ? DockerHost : envValue;
}
}
}