rommapp / romm

A beautiful, powerful, self-hosted rom manager
https://romm.app
GNU Affero General Public License v3.0
2.15k stars 92 forks source link

[Feature] Docker Healthcheck / Health API endpoint #1098

Closed saschabrockel closed 2 months ago

saschabrockel commented 2 months ago

Is your feature request related to a problem? Please describe. I would like to know if the container is in a healthy state or if it is not responding anymore for example and can also automatically react to unhealthy states.

Describe the solution you'd like It would be nice if either the Dockerfile would already include a Docker healthcheck like

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
  CMD curl -f http://localhost:8080/health || exit 1

It does not need to be curl. I can also be wget which is available already.

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
  CMD wget -nv -t1 --spider http://localhost:8080 || exit 1

Describe alternatives you've considered Otherwise, at least create an API endpoint like /health which just returns status code 200 and we know the container is in a working state.

Currently, you can create a Docker healthcheck on http://localhost:8080 which is overload with wget.

gantoine commented 2 months ago

You can use /api/heartbeat to see if the app is up and running correctly, it'll return a 200 status code and a bunch of config properties in JSON format.

saschabrockel commented 2 months ago

Thank you @gantoine worth to note it somewhere in the docs :)