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

[Feature Request] Docker Healthchecks #73

Open
alx-xlx opened this issue Jan 25, 2025 · 3 comments
Open

[Feature Request] Docker Healthchecks #73

alx-xlx opened this issue Jan 25, 2025 · 3 comments

Comments

@alx-xlx
Copy link

alx-xlx commented Jan 25, 2025

Hey it would be an awesome feature to add the docker healthchecks.

I couldn't use curl , wget etc

@daya0576
Copy link
Owner

Hi thanks for opening the request, could you share any wiki or documentation about "docker healthchecks"?

@sebbo2002
Copy link

Docker Reference: https://docs.docker.com/reference/dockerfile/#healthcheck
Usually it's a HTTP Request to some health endpoint.

@alx-xlx
Copy link
Author

alx-xlx commented Jan 27, 2025

Yes that's correct, it is probably an easy fix. Just including either curl, wget, netstat commands etc in the docker image would do the trick.

and the following compose file with healthchecks will work fine.

services:
  beaverhabits:
    container_name: beaverhabits
    user: 1000:1000 # User permissions of your docker or default user.
    environment:
      # See the note below to find all the environment variables
      - HABITS_STORAGE=USER_DISK # DATABASE stores in a single SQLite database named habits.db. USER_DISK option saves in a local json file.
    volumes:
      - /home/pi/data/beaverhabits/habits:/app/.user/ # Change directory to match your docker file scheme.
    ports:
      - 8080:8080
    restart: unless-stopped
    image: daya0576/beaverhabits:latest
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s

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

3 participants