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

[FEAT] documentation on docker compose healthcheck #138

Closed
1 task done
TrueOsiris opened this issue Jul 26, 2024 · 5 comments
Closed
1 task done

[FEAT] documentation on docker compose healthcheck #138

TrueOsiris opened this issue Jul 26, 2024 · 5 comments
Labels
enhancement New feature or request no-issue-activity

Comments

@TrueOsiris
Copy link

TrueOsiris commented Jul 26, 2024

Is this a new feature request?

  • I have searched the existing issues

Wanted change

Would you be so kind to add a section on a docker compose healthcheck in the readme.me

Reason for change

it took me a while crawling the internet, grabbing bits and pieces all around on obscure fora to get the information.
And a docker healthcheck is quite a common thing in modern solutions.

Proposed code change

Docker Compose healthcheck

After running the bazarr container without a healthcheck, access the gui and read out the api key.

Add a docker secrets file, as mentioned above, or add a line to the .env file.

BAZARRAPIKEY=yourapikey

Then add the healthcheck section to to the docker compose file and restart the container.

The env_file lines are optional, as a docker compose container should always look for a .env.

---
services:
  bazarr:
    image: lscr.io/linuxserver/bazarr:latest
    container_name: bazarr
    env_file:
      - ./.env  
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /path/to/bazarr/config:/config
      - /path/to/movies:/movies #optional
      - /path/to/tv:/tv #optional
    ports:
      - 6767:6767
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "curl -sSf http://127.0.0.1:6767/api/system/status?apikey=$$BAZARRAPIKEY || exit 1"]
      interval: 30s # n° seconds to initially wait before executing the health check + frequency of subsequent health checks.
      timeout: 10s # n° of seconds Docker awaits for your health check command to return an exit code before declaring it as failed.
      retries: 5  # n° of consecutive health check failures required to declare the container as unhealthy.
      start_period: 30s  # wait before starting the healthcheck after container launch
@TrueOsiris TrueOsiris added the enhancement New feature or request label Jul 26, 2024
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@j0nnymoe
Copy link
Member

Personally I don't think it's right to have this part of a containers readme as this is more general practice on how to use healthchecks with any container.

I would be surprised if this documentation wasn't already in docker composes documentation.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@Dudleydogg
Copy link

The TZ throws error for me and wants different format:
If you build the docker with this compose it will run the file but throw an error not liking the TZ= says not compatible wants you to use - TZ=America/New_York type format.

@aptalca aptalca closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Aug 30, 2024
Copy link

This issue is locked due to inactivity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request no-issue-activity
Projects
Archived in project
Development

No branches or pull requests

5 participants