Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Healthcheck on librephotos-frontend? #89

Open
joe-eklund opened this issue Feb 23, 2023 · 1 comment
Open

Healthcheck on librephotos-frontend? #89

joe-eklund opened this issue Feb 23, 2023 · 1 comment

Comments

@joe-eklund
Copy link

Hello-

I am attempting to get a healthcheck for the frontend container of librephotos but have run into an issue. It looks like the frontend image is built on halverneus/static-file-server, which in turn is built on scratch. This means it doesn't have curl or wget, which is what I typically use for my healthchecks to check http servers.

This means this doesn't work in my compose file:

  librephotos-frontend:
    image: reallibrephotos/librephotos-frontend:latest
    container_name: librephotos-frontend
    restart: unless-stopped
    environment:
      - TZ=America/Los_Angeles
    depends_on:
      - librephotos-backend
    networks:
      - librephotos_internal
    labels:
      - traefik.enable=false
    healthcheck:
      test: ["CMD", "wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1"]
      interval: 60s
      retries: 3
      start_period: 20s
      timeout: 15s

or something like

    healthcheck:
      test: ["CMD", "curl --fail http://localhost:3000 || exit 1"]
      interval: 60s
      retries: 3
      start_period: 20s
      timeout: 15s

I am wondering if a HEALTHCHECK can be added to the Dockerfile, since I don't see anyway to accomplish this using the docker-compose healthcheck vernacular. Here is one example on how to accomplish this with scratch based images.

Another solution would be to bake in wget or curl in your image, but unless you had some other reason for it, I understand not wanting it in there.

Thoughts?

@stnokott
Copy link

stnokott commented Oct 4, 2023

Related: halverneus/static-file-server#100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants