flatnotes icon indicating copy to clipboard operation
flatnotes copied to clipboard

[Feature Request] Add healthcheck for contaiers

Open t4nki opened this issue 1 year ago • 3 comments

Hi,

As of now, there is no way to do a curl http://localhost:8080 or a wget --spider http://localhost:8080 to get a container healthcheck. So far, I managed to get pidof python but i rekon this might not be the best option.

Would it be possible to provide either curl or wget binary inside the container?

Also, even though providing a fixed listening port could have its advantages, it also prevents hosting Flatnotes aside other containers using port 8080.

Would you reconsider providing a way to define a listening port through environment variables?

Thank you for considering these demands

Cheers

t4nki avatar Dec 23 '23 23:12 t4nki

I wouldn't be opposed to this but if I added curl I'd also want to add a /health endpoint for it to call. And if I do the latter then I'd need to exclude it from the access logs (else they would get filled up very quickly). Log filtering in FastAPI requires some investigation.

dullage avatar Feb 06 '24 19:02 dullage

That would be great ! From what I gathered from the internets, it looks feasible, which is a good start :)

I'm no devlopper, but I would be happy to help through testing

Thanks

t4nki avatar Feb 07 '24 18:02 t4nki

I'm currently testing a heathcheck so hope to have this in the next release.

dullage avatar Feb 09 '24 17:02 dullage

everything looks good to me, thanks for the health endpoint !

t4nki avatar Apr 18 '24 16:04 t4nki