pocketbase icon indicating copy to clipboard operation
pocketbase copied to clipboard

Added Healthcheck

Open frankdierolf opened this issue 7 months ago • 0 comments

Hola 👋

Problem

Every time you spin up a PocketBaseInstant (e.g. on Coolify), you get that persistent "not healthy" warning — even though the app is running just fine.

Idea

Let’s fix that so the container shows up as healthy when PocketBase is actually ready.

Solution

  • Added curl and wget to the container (needed for the health check logic).
  • Added a Docker-native HEALTHCHECK that pings the /api/health endpoint — Coolify (and others) can now correctly detect when the service is up.

Healthcheck config (open for feedback):

HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
  CMD curl --fail http://localhost:8080/api/health || exit 1

To Discuss

  • Is 30s a good interval?
  • Should we use different retry or timeout values?
  • Any edge cases where this endpoint might mislead?

Let me know what you think! Happy to tweak the values or approach based on feedback. If I would maintain this repo, I would merge it, alias lgtm. ^^

frankdierolf avatar May 19 '25 12:05 frankdierolf