docker-telegram-bot-api icon indicating copy to clipboard operation
docker-telegram-bot-api copied to clipboard

change healthcheck to 127.0.0.1

Open vaaski opened this issue 1 year ago • 0 comments

Hey,

I've been using this container quite successfully for months now, however using network_mode: host seems to make my health check fail, marking it as unhealthy. This is probably due to the extra step of resolving localhost to 127.0.0.1.

I couldn't build the image locally, but from my testing (attaching to /bin/sh inside the container) it achieves the desired result more reliably.

image

EDIT: As a workaround you can override the healthcheck without rebuilding the image:

healthcheck:
  test: ["CMD-SHELL", "nc -z 127.0.0.1 8081 || exit 1"]
  interval: 5s
  timeout: 30s
  retries: 3

vaaski avatar Jul 16 '24 14:07 vaaski