Skip to content

Commit c2328b4

Browse files
committed
Add basic health check
1 parent 8b79567 commit c2328b4

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

backend/app/api/routes/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ def test_email(email_to: EmailStr) -> Message:
2424
html_content=email_data.html_content,
2525
)
2626
return Message(message="Test email sent")
27+
28+
29+
@router.get("/health-check/")
30+
async def health_check() -> bool:
31+
return True

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ services:
6363
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
6464
- SENTRY_DSN=${SENTRY_DSN}
6565

66+
healthcheck:
67+
test: ["CMD", "curl", "-f", "http://localhost/api/v1/utils/health-check/"]
68+
interval: 10s
69+
timeout: 5s
70+
retries: 5
71+
6672
build:
6773
context: ./backend
6874
args:

frontend/src/client/services.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,18 @@ export class UtilsService {
386386
},
387387
})
388388
}
389+
390+
/**
391+
* Health Check
392+
* @returns boolean Successful Response
393+
* @throws ApiError
394+
*/
395+
public static healthCheck(): CancelablePromise<boolean> {
396+
return __request(OpenAPI, {
397+
method: "GET",
398+
url: "/api/v1/utils/health-check/",
399+
})
400+
}
389401
}
390402

391403
export type TDataReadItems = {

0 commit comments

Comments
 (0)