Files
CaddyManager/CaddyManager.Contracts/Configurations/Docker/DockerServiceConfiguration.cs
ebolo d0687c9134
All checks were successful
Caddy Manager CI build / docker (push) Successful in 11m33s
feat(docker): Gracefully reload Caddy configuration
2026-07-26 11:39:59 +07:00

38 lines
1.3 KiB
C#

namespace CaddyManager.Contracts.Configurations.Docker;
/// <summary>
/// Configuration for the Docker service
/// </summary>
public class DockerServiceConfiguration
{
public const string Docker = "Docker";
/// <summary>
/// Name of the Caddy container to be controlled (i.e restart)
/// </summary>
public string CaddyContainerName { get; set; } = "caddy";
/// <summary>
/// Uri to the Docker host
/// </summary>
public string DockerHost { get; set; } = "unix:///var/run/docker.sock";
/// <summary>
/// Path to the Caddyfile as seen from inside the Caddy container, used by `caddy reload`. Must match the
/// container side of the Caddy container's config volume mount.
/// </summary>
public string CaddyConfigPathInContainer { get; set; } = "/etc/caddy/Caddyfile";
/// <summary>
/// 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
/// </summary>
public string DockerHostWithEnvCheck
{
get
{
var envValue = Environment.GetEnvironmentVariable("DOCKER_HOST");
return string.IsNullOrWhiteSpace(envValue) ? DockerHost : envValue;
}
}
}