[GH-ISSUE #326] [FR] Adding Healthchecks do the dockerfiles #211

Closed
opened 2026-03-02 11:47:39 +03:00 by kerem · 12 comments
Owner

Originally created by @wuast94 on GitHub (Jul 26, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/326

would be nice if healthchecks would be added to the containers 😊 im running a swam cluster and containers without a healtheck can make problems

Originally created by @wuast94 on GitHub (Jul 26, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/326 would be nice if healthchecks would be added to the containers 😊 im running a swam cluster and containers without a healtheck can make problems
kerem 2026-03-02 11:47:39 +03:00
Author
Owner

@MohamedBassem commented on GitHub (Jul 27, 2024):

@wuast94 Makes sense. You can define the healthchecks manually from the compose file as well btw.

<!-- gh-comment-id:2254233433 --> @MohamedBassem commented on GitHub (Jul 27, 2024): @wuast94 Makes sense. You can define the healthchecks manually from the compose file as well btw.
Author
Owner

@wuast94 commented on GitHub (Jul 27, 2024):

yeah i know, the thing is on the worker part i dont even know how to define the healthcheck.

on the web part it should be an extra endpoint that just return a json or something like that if the web part and all sub parts are working as intended (redis db and so on), its more efficient than just checking a rendered html page.

<!-- gh-comment-id:2254262276 --> @wuast94 commented on GitHub (Jul 27, 2024): yeah i know, the thing is on the worker part i dont even know how to define the healthcheck. on the web part it should be an extra endpoint that just return a json or something like that if the web part and all sub parts are working as intended (redis db and so on), its more efficient than just checking a rendered html page.
Author
Owner

@MohamedBassem commented on GitHub (Jul 27, 2024):

@wuast94 makes sense. The good news is that the worker container is going away in the next release. For the web container, I can add a dummy ping endpoint.

<!-- gh-comment-id:2254262619 --> @MohamedBassem commented on GitHub (Jul 27, 2024): @wuast94 makes sense. The good news is that the worker container is going away in the next release. For the web container, I can add a dummy ping endpoint.
Author
Owner

@wuast94 commented on GitHub (Jul 27, 2024):

well than it can be a thing i can do maybe. im in the beginning of development (atm im building a web app with svelte), but an healtheck endpoint seams like a nice thing to do for learning 😊

<!-- gh-comment-id:2254263257 --> @wuast94 commented on GitHub (Jul 27, 2024): well than it can be a thing i can do maybe. im in the beginning of development (atm im building a web app with svelte), but an healtheck endpoint seams like a nice thing to do for learning 😊
Author
Owner

@MohamedBassem commented on GitHub (Jul 27, 2024):

@wuast94 Sure! Hoarder uses Next.js. You can drop a ping/route.ts here (https://github.com/hoarder-app/hoarder/tree/main/apps/web/app/api) and implement a dummy endpoint (using this docs: https://nextjs.org/docs/app/api-reference/file-conventions/route) to return a plain text containing "PONG" for example. Then you should be able to call it with http://localhost:3000/api/ping

<!-- gh-comment-id:2254264267 --> @MohamedBassem commented on GitHub (Jul 27, 2024): @wuast94 Sure! Hoarder uses Next.js. You can drop a `ping/route.ts` here (https://github.com/hoarder-app/hoarder/tree/main/apps/web/app/api) and implement a dummy endpoint (using this docs: https://nextjs.org/docs/app/api-reference/file-conventions/route) to return a plain text containing "PONG" for example. Then you should be able to call it with `http://localhost:3000/api/ping`
Author
Owner

@wuast94 commented on GitHub (Jul 27, 2024):

yeah sounds like a nice starting point. if i can i will also return if the redis and db connection are ok 😊

<!-- gh-comment-id:2254264669 --> @wuast94 commented on GitHub (Jul 27, 2024): yeah sounds like a nice starting point. if i can i will also return if the redis and db connection are ok 😊
Author
Owner

@MohamedBassem commented on GitHub (Jul 27, 2024):

Redis is going away, and the db is sqlite db, so it's usually always ok :)

<!-- gh-comment-id:2254265311 --> @MohamedBassem commented on GitHub (Jul 27, 2024): Redis is going away, and the db is sqlite db, so it's usually always ok :)
Author
Owner

@wuast94 commented on GitHub (Jul 27, 2024):

my bad i meaned meilisearch

<!-- gh-comment-id:2254266363 --> @wuast94 commented on GitHub (Jul 27, 2024): my bad i meaned meilisearch
Author
Owner

@MohamedBassem commented on GitHub (Sep 22, 2024):

This is now done with your PR, thanks!

<!-- gh-comment-id:2366726936 --> @MohamedBassem commented on GitHub (Sep 22, 2024): This is now done with your PR, thanks!
Author
Owner

@huyz commented on GitHub (Oct 7, 2024):

Should the Dockerfile and/or docker-compose.yml files be updated to include the healthcheck?

<!-- gh-comment-id:2396266826 --> @huyz commented on GitHub (Oct 7, 2024): Should the Dockerfile and/or docker-compose.yml files be updated to include the healthcheck?
Author
Owner

@wuast94 commented on GitHub (Oct 7, 2024):

i will do a PR

<!-- gh-comment-id:2397645470 --> @wuast94 commented on GitHub (Oct 7, 2024): i will do a PR
Author
Owner

@wuast94 commented on GitHub (Oct 7, 2024):

@huyz #508 will add this

<!-- gh-comment-id:2397733547 --> @wuast94 commented on GitHub (Oct 7, 2024): @huyz #508 will add this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#211
No description provided.