5

I added health check to my Dockerfile:

HEALTHCHECK --interval=1m --timeout=5s --retries=2 --start-period=10s \
  CMD wget -qO- http://localhost:8070/healthcheck || exit 1

In my project main urls.py file I added entry:

url(r'^healthcheck/', lambda r: HttpResponse())

The project is activated and deployed, so I can understand the healthcheck is valid, however - I keep getting:

2017-12-17 13:25:27,891 WARNING base 51 140551932685128 Not Found: /healthcheck

written to the logs (once a minute). The log entry is added also when I run the wget from inside the server.

Is it an issue with the healthcheck syntax, the django entry set up or the wget in docker?

Please assist. Thanks.

1
  • Does the container have a healtheck field, when you inspect the container ? docker inspect <id> --format "{{.Config.Healthcheck}}" I tried the HEALTCHECK line and got after building: Unknown type "\\" in HEALTHCHECK (try CMD) After removing the backslash between start-period and CMD it worked
    – invad0r
    Dec 17, 2017 at 16:40

1 Answer 1

3

the healthcheck url: http://localhost:8070/healthcheck

should be: http://localhost:8070/healthcheck/

because the trailing slashes setting in django.

2
  • is there a hack to make it without slash as some loadbalancers redirects if slash is present at end Apr 26, 2019 at 10:05
  • @MohitAngiras - remove/modify the trailing slashes setting
    – Asaf Maoz
    Oct 24, 2019 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.