pocketbase
pocketbase copied to clipboard
Added Healthcheck
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
curlandwgetto the container (needed for the health check logic). - Added a Docker-native
HEALTHCHECKthat pings the/api/healthendpoint — 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
30sa 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. ^^