healthchecks/docker/fetchstatus.sh
Pēteris Caune 8fed685f12
Update Dockerfile to report container health in docker ps
This commit adds a HEALTHCHECK instruction in Dockerfile.
The HEALTHCHECK instruction calls /docker/fetchstatus.sh
which in turn makes a HTTP request to
http://localhost:8000/api/v3/status/
This endpoint makes a test database query and returns non-200
response if the query fails. So, in short, if the Healthchecks
container for any reason is unable to query database, `docker ps`
will now show the container as "unhealthy".

cc: #1045
2024-08-19 10:17:05 +03:00

1 line
No EOL
95 B
Bash
Executable file

python -c "from urllib.request import urlopen; urlopen('http://localhost:8000/api/v3/status/')"