Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Adding Healthchecks do the dockerfiles #326

Closed
wuast94 opened this issue Jul 26, 2024 · 12 comments
Closed

[FR] Adding Healthchecks do the dockerfiles #326

wuast94 opened this issue Jul 26, 2024 · 12 comments
Labels
feature request New feature or request

Comments

@wuast94
Copy link
Contributor

wuast94 commented Jul 26, 2024

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

@MohamedBassem MohamedBassem added the feature request New feature or request label Jul 27, 2024
@MohamedBassem
Copy link
Collaborator

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

@wuast94
Copy link
Contributor Author

wuast94 commented 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.

@MohamedBassem
Copy link
Collaborator

@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.

@wuast94
Copy link
Contributor Author

wuast94 commented 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 😊

@MohamedBassem
Copy link
Collaborator

@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

@wuast94
Copy link
Contributor Author

wuast94 commented 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 😊

@MohamedBassem
Copy link
Collaborator

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

@wuast94
Copy link
Contributor Author

wuast94 commented Jul 27, 2024

my bad i meaned meilisearch

@MohamedBassem
Copy link
Collaborator

This is now done with your PR, thanks!

@huyz
Copy link

huyz commented Oct 7, 2024

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

@wuast94
Copy link
Contributor Author

wuast94 commented Oct 7, 2024

i will do a PR

@wuast94
Copy link
Contributor Author

wuast94 commented Oct 7, 2024

@huyz #508 will add this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants