public void Initialize(HealthConfig healthConfig) { config = healthConfig; if (config != null) { currentHealth = config.MaxHealth; } }
public HealthData(Human human, HealthConfig config) { m_human = human; m_config = config; }
public virtual async Task <CreateContainerResponse> CreateContainer(string image) { LogConfig logConfig = new LogConfig(); for (int i = 0; i < this.Volumes.Count; i++) { this.Volumes[i] = $"{this.Path}{System.IO.Path.DirectorySeparatorChar}{this.Volumes[i]}"; } HealthConfig healthConfig = null; if (this.HealthCheck.Count > 0) { healthConfig = new HealthConfig() { Interval = TimeSpan.FromSeconds(5), Retries = 5, //Bad JSON conversion for Timeout, value need to be in nanosecond. Timeout = TimeSpan.FromSeconds(2 * 1000000000), Test = this.HealthCheck, }; } return(await this.DockerClient.Containers.CreateContainerAsync ( new CreateContainerParameters ( new Docker.DotNet.Models.Config() { Image = image, Env = this.Env, Cmd = this.Cmd, ExposedPorts = this.ExposedPorts, AttachStderr = false, AttachStdin = false, AttachStdout = true, Healthcheck = healthConfig } ) { Name = this.Name, HostConfig = new HostConfig() { PortBindings = this.PortBindings, AutoRemove = false, Binds = this.Volumes, LogConfig = this.LogConfig, Isolation = this.DenConfig.DenDockerConfigObject.Platform == Platforms.Windows.ToString() ? "process" : string.Empty, }, NetworkingConfig = new NetworkingConfig() { EndpointsConfig = new Dictionary <string, EndpointSettings> { { "den-network", new EndpointSettings() { NetworkID = this.DenServicesController.DenNetwork.NetworkId } } } } } )); }