traefik / whoami

Tiny Go server that prints os information and HTTP request to output

Home Page:https://traefik.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add curl to image for use native HEALTHCHECK

4n70w4 opened this issue · comments

Would love this as well. Some form of built-in healthcheck would be nice.

commented

Yes, it would be good to have any form of healthcheck.

in the meantime you guys could do this (dockerfile_inline works in newer docker-compose versions):

version: '2.4'
services:
  whoami:
    container_name: whoami
    build:
      context: .
      dockerfile_inline: |
        FROM traefik/whoami
        COPY --from=ghcr.io/tarampampam/curl /bin/curl /curl
        HEALTHCHECK --interval=10s --start-period=2s CMD ["/curl", "--fail", "http://127.0.0.1:80/health"]
    restart: always

I Opened PR #81