Skip to content

Commit 47eb7d3

Browse files
committed
feat: Add health check endpoints for application readiness and liveness
1 parent 83e0f19 commit 47eb7d3

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/build-and-push-containers.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ jobs:
3030
dotnet publish src/Playground/Playground.Api/Playground.Api.csproj \
3131
-c Release -r linux-x64 \
3232
-p:PublishProfile=DefaultContainer \
33-
-p:ContainerRegistry=ghcr.io \
34-
-p:ContainerRepository=${{ github.repository_owner }}/fsh-playground-api \
33+
-p:ContainerRegistry=ghcr.io/${{ github.repository_owner }} \
34+
-p:ContainerRepository=fsh-playground-api \
3535
-p:ContainerImageTags=${{ github.sha }}
3636
3737
- name: Publish Blazor container image
3838
run: |
3939
dotnet publish src/Playground/Playground.Blazor/Playground.Blazor.csproj \
4040
-c Release -r linux-x64 \
4141
-p:PublishProfile=DefaultContainer \
42-
-p:ContainerRegistry=ghcr.io \
43-
-p:ContainerRepository=${{ github.repository_owner }}/fsh-playground-blazor \
42+
-p:ContainerRegistry=ghcr.io/${{ github.repository_owner }} \
43+
-p:ContainerRepository=fsh-playground-blazor \
4444
-p:ContainerImageTags=${{ github.sha }}
4545
4646
- name: Push API image to GHCR

src/Playground/Playground.Blazor/Program.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
app.UseHsts();
3131
}
3232

33+
// Simple health endpoints for ALB/ECS
34+
app.MapGet("/health/ready", () => Results.Ok(new { status = "Healthy" }))
35+
.AllowAnonymous();
36+
37+
app.MapGet("/health/live", () => Results.Ok(new { status = "Alive" }))
38+
.AllowAnonymous();
39+
3340
app.UseHttpsRedirection();
3441
app.UseAntiforgery();
3542

0 commit comments

Comments
 (0)