[PR #2996] [CLOSED] Make container get to a healthy state faster (60s -> 10s) #21407

Closed
opened 2026-04-30 07:55:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/2996
Author: @spantaleev
Created: 12/16/2022
Status: Closed

Base: mainHead: speed-up-health-check


📝 Commits (1)

  • d59197d Make container get to a healthy state faster (60s -> 10s)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 docker/Dockerfile.j2 (+1 -1)

📄 Description

The way Docker health checks work is:

  1. The container is started
  2. Docker waits a full healthcheck interval
  3. A healthcheck is made. If OK, mark as healthy

The problem is that (as described in 2.), Docker always waits a full interval before doing the first check. The interval configuration serves 2 purposes:

  • wait time before the first health check
  • wait time between subsequent health checks

This annoyance is also described in: https://github.com/moby/moby/issues/33410

The way this manifests as a problem is when reverse-proxying with Traefik, like we do by default in https://github.com/spantaleev/vaultwarden-docker-ansible-deploy

Traefik refuses to reverse-proxy to containers which are unhealthy (Health Status=starting is also considered unhealthy).

This means that Vaultwarden, with its current 60 second healthcheck interval will take a full minute to become healthy and to be reachable by Traefik.

In vaultwarden-docker-ansible-deploy, we currently work around this by overriding the default health check interval:
015c459970/roles/custom/devture_vaultwarden/templates/vaultwarden.service.j2 (L15-L36)

With our workaround (which this patch also applies), it only takes 10 seconds after Vaultwarden startup and until Traefik would reverse-proxy to it.


This PR only updates docker/Dockerfile.j2. I haven't executed make in docker/, but I could do it and push that too if you'd like. Feel free to also do it yourself though!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/2996 **Author:** [@spantaleev](https://github.com/spantaleev) **Created:** 12/16/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `speed-up-health-check` --- ### 📝 Commits (1) - [`d59197d`](https://github.com/dani-garcia/vaultwarden/commit/d59197d62aac63ffd8c34476b915ad761c8e9848) Make container get to a healthy state faster (60s -> 10s) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docker/Dockerfile.j2` (+1 -1) </details> ### 📄 Description The way Docker health checks work is: 1. The container is started 2. Docker waits a full healthcheck `interval` 3. A healthcheck is made. If OK, mark as healthy The problem is that (as described in 2.), Docker always waits a full interval before doing the first check. The `interval` configuration serves 2 purposes: - wait time before the first health check - wait time between subsequent health checks This annoyance is also described in: https://github.com/moby/moby/issues/33410 The way this manifests as a problem is when reverse-proxying with Traefik, like we do by default in https://github.com/spantaleev/vaultwarden-docker-ansible-deploy Traefik refuses to reverse-proxy to containers which are unhealthy (Health Status=starting is also considered unhealthy). This means that Vaultwarden, with its current 60 second healthcheck interval will take a full minute to become healthy and to be reachable by Traefik. In vaultwarden-docker-ansible-deploy, we currently work around this by overriding the default health check interval: https://github.com/spantaleev/vaultwarden-docker-ansible-deploy/blob/015c459970d41743bd75980c2df02e389e1b461b/roles/custom/devture_vaultwarden/templates/vaultwarden.service.j2#L15-L36 With our workaround (which this patch also applies), it *only* takes 10 seconds after Vaultwarden startup and until Traefik would reverse-proxy to it. ---- This PR only updates `docker/Dockerfile.j2`. I haven't executed `make` in `docker/`, but I could do it and push that too if you'd like. Feel free to also do it yourself though! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 07:55:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#21407