[FEAT] documentation on docker compose healthcheck
Is this a new feature request?
- [X] 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
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
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.
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.
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.
This issue is locked due to inactivity