Healthchecks (EN)

Concept

Automated checks to monitor container status over time

Definition

Healthchecks are automated checks that monitor the status of a container over time and enable automatic restarting of failed containers. They define tests that Docker regularly performs to determine if an application within a container is functioning correctly. Through healthchecks, you can improve the reliability of your application environments, as faulty components are automatically detected and repaired.

Lifecycle

stateDiagram-v2     [*] --> Starting     Starting --> Running: Start     Running --> Healthy: Healthcheck passed     Running --> Unhealthy: Healthcheck failed     Healthy --> Running: Further check     Unhealthy --> Restart: Configured failure attempts reached     Restart --> Running: Restart     Restart --> [*]: Max. restarts reached     Running --> [*]: Stop 

In Context

  • Typically used together with Docker Compose and Kubernetes
  • Related to: Container Orchestration, Service Discovery, Load Balancing
  • Example use: Web applications, database services, microservices
Quelle: AI Generated