opensafely-core / opencodelists

OpenCodelists is an open platform for creating and sharing codelists of clinical terms and drugs.
https://www.opencodelists.org
Other
31 stars 11 forks source link

Add health check endpoint #2154

Open iaindillingham opened 6 days ago

iaindillingham commented 6 days ago

At present, a single user-defined health check runs after a new container is started, but before it receives connections. Essentially, the Dokku host curls the new container, requesting the root URL (see #2148 and #2156).

https://github.com/opensafely-core/opencodelists/blob/b3da21a5125a19b968d99f17da7fe3d0da8667e3/app.json#L9-L26

A 200 response from the root URL isn't necessarily a good indicator that the new container is healthy. The root URL is also slow to respond (see #1857). job-server has a HealthCheck view, which returns a 200 response (jobserver/views/health_check.py, https://jobs.opensafely.org/health-check/). OpenCodelists should have the same; it should be used by Freshping.