feat: Add /healthz/live and /healthz/ready health check endpoints#25
Merged
jthomperoo merged 3 commits intomainfrom Mar 23, 2026
Merged
feat: Add /healthz/live and /healthz/ready health check endpoints#25jthomperoo merged 3 commits intomainfrom
jthomperoo merged 3 commits intomainfrom
Conversation
…h Docker HEALTHCHECK Co-authored-by: jthomperoo <6690498+jthomperoo@users.noreply.github.com> Agent-Logs-Url: https://github.com/BusinessSimulations/dev-oidc-toolkit/sessions/30d66c11-eec3-4fe6-924c-2046a2f1683b
Copilot
AI
changed the title
[WIP] Add HEALTHCHECK to Dockerfile for service health monitoring
feat: Add /healthz/live and /healthz/ready health check endpoints
Mar 22, 2026
jthomperoo
requested changes
Mar 22, 2026
Member
jthomperoo
left a comment
There was a problem hiding this comment.
Should we not have ready check DB is reachable? I'm aware it's just SQLite supported, but if SQLite is set up should we not check it's available and reachable?
Co-authored-by: jthomperoo <6690498+jthomperoo@users.noreply.github.com> Agent-Logs-Url: https://github.com/BusinessSimulations/dev-oidc-toolkit/sessions/00f44f31-833f-423c-b929-3f550c50e447
Contributor
Author
Done in 460b394. When |
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Docker image lacked both health check tooling (
curl/wget) and aHEALTHCHECKinstruction, making it impossible for orchestrators to determine service readiness without custom workarounds.Changes
Program.cs— Registers ASP.NET Core built-in health checks and maps two endpoints:GET /healthz/live— liveness probe (app process is running; never checks external dependencies)GET /healthz/ready— readiness probe (app is ready to serve requests; additionally verifies SQLite database connectivity whenDatabase.SqliteFileis configured)Dockerfile— Installscurlin the runtime stage; addsHEALTHCHECKusing it:DevOidcToolkit.csproj— AddsMicrosoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCoreto supportAddDbContextCheck.Docs — New
health-checks.mdpage covering endpoint reference, the liveness/readiness distinction, database check behaviour, and a Docker Composedepends_on: condition: service_healthyexample; linked from the docs index and README features list.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.