diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 87eaea68..d55d8570 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -8,6 +8,11 @@ services: - DO_PULL=true ports: - "5000:5000" + healthcheck: + test: ["CMD", "curl", "-f", "http://127.0.0.1:5000/health"] + interval: 30s + timeout: 10s + retries: 3 environment: - NAME=TabbyAPI - NVIDIA_VISIBLE_DEVICES=all diff --git a/endpoints/core/router.py b/endpoints/core/router.py index a857a1a1..88505242 100644 --- a/endpoints/core/router.py +++ b/endpoints/core/router.py @@ -44,6 +44,13 @@ router = APIRouter() +# Healthcheck endpoint +@router.get("/health") +async def healthcheck(): + """Get the current service health status""" + return {"status": "healthy"} + + # Model list endpoint @router.get("/v1/models", dependencies=[Depends(check_api_key)]) @router.get("/v1/model/list", dependencies=[Depends(check_api_key)])