Skip to content

Update healthcheck endpoint in docker-compose.yml from /api/v1/trending to /api/v1/stats for better reliability #678

@SolarisEclipse

Description

@SolarisEclipse

Description

The current healthcheck in docker-compose.yml for the invidious service uses /api/v1/trending (wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1), which can fail in certain setups (e.g., with Traefik as a reverse proxy), preventing the container from being exposed even when the app is otherwise functional. Switching to /api/v1/stats resolves this without issues.
This was discussed in a community chat (screenshot attached for reference), where maintainer @unixfox requested an issue as a reminder to make the change.

Steps to Reproduce

Deploy Invidious via docker-compose with Traefik labels enabled.
Observe Traefik logs showing healthcheck failures on /trending.
Remove or change the healthcheck to /stats; the setup works.

Proposed Solution

Update the healthcheck test in docker-compose.yml to:

  test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/stats || exit 1
  interval: 30s
  timeout: 5s
  retries: 2

This endpoint is lighter and more consistent, per API docs.

Additional Context

/trending may fail due to load or optional param dependencies, while /stats is always quick.
No damage from the change, as noted in the discussion.
Attach screenshot of chat for full context.

Labels: enhancement, docker

Image

Sources Used (with Dates):

Invidious API Documentation (accessed 2025, last updated ~2023): Confirmed /trending and /stats endpoints.
Invidious Installation Guide (accessed 2025, last updated ~2024): Verified current healthcheck config.
GitHub Issue #2982 (March 2022): Historical note on /trending param bugs, though not directly related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions