Skip to content

feat(infra) Phase 7 A1 — Dockerfiles for Web and Api#220

Merged
jkeeley2073 merged 1 commit into
mainfrom
Dev-Phase7-A1
May 15, 2026
Merged

feat(infra) Phase 7 A1 — Dockerfiles for Web and Api#220
jkeeley2073 merged 1 commit into
mainfrom
Dev-Phase7-A1

Conversation

@jkeeley2073
Copy link
Copy Markdown
Contributor

Summary

Adds production Dockerfiles for PinballWizard.Web (Blazor Web App) and PinballWizard.Api (SSE/JSON host). These are the first step toward replacing the ACA placeholder images provisioned in PR #218 (A0).

Web Dockerfile

  • Base image: mcr.microsoft.com/dotnet/aspnet:10.0 (not runtime — Kestrel required)
  • Layer cache pattern: separate restore stage (csproj + props only) from publish stage (full source)
  • No --no-restore on publish: Microsoft.Extensions.Telemetry.Abstractions is a transitive dep of Microsoft.Extensions.Http.Resilience 10.5.0 not declared in CPM — --no-restore caused NETSDK1064; removing it lets publish do a fast re-verify against the already-warm global package cache
  • AzureAd placeholder GUIDs baked as ENV vars — same fix as lighthouse.yml CI; satisfies AddMicrosoftIdentityWebApp MergedOptionsValidation on anonymous routes without enabling real OIDC
  • ASPNETCORE_FORWARDEDHEADERS_ENABLED=true — ACA terminates TLS at ingress; container receives plain HTTP
  • Non-root user pinwiz — GID/UID auto-assigned (not hardcoded) to avoid groupadd: GID already exists on the aspnet base image

Api Dockerfile

  • Same structure, simpler: no Web.Client reference, no AzureAd env vars needed
  • Internal-only ACA ingress — called by Web via Aspire service discovery (services__pinwiz-api__http__0)

Smoke test

docker build -t pinwiz-web:smoke-test -f src/PinballWizard.Web/Dockerfile . → ✅
docker run --rm -p 8080:8080 pinwiz-web:smoke-test → GET /alive → HTTP 200 ✅
docker build -t pinwiz-api:smoke-test -f src/PinballWizard.Api/Dockerfile . → ✅

Next

A2 — deploy.yml GitHub Actions workflow (OIDC auth, az acr build, az containerapp update). Requires operator B3 (OIDC federated credential in Entra) before it can authenticate.

🤖 Generated with Claude Code

src/PinballWizard.Web/Dockerfile:
- Multi-stage (sdk:10.0 → aspnet:10.0); non-root pinwiz user; port 8080
- Restore stage copies only csproj + props for layer cache; publish stage
  copies full src/. Separate restore + publish (no --no-restore) so that
  transitive packages not in CPM (e.g. Microsoft.Extensions.Telemetry.Abstractions)
  are resolved by the publish restore pass using the already-warm global cache.
- AzureAd placeholder GUIDs baked as ENV vars (Instance/TenantId/ClientId)
  to satisfy AddMicrosoftIdentityWebApp MergedOptionsValidation on anonymous
  routes without enabling real OIDC — same pattern as lighthouse.yml CI.
- ASPNETCORE_FORWARDEDHEADERS_ENABLED=true so ACA X-Forwarded-* headers are
  trusted (TLS terminated at the ACA ingress, not in the container).

src/PinballWizard.Api/Dockerfile:
- Same multi-stage structure; no Web.Client or AzureAd env vars needed.
- Internal ACA ingress (external=false) — only called by the Web app via
  Aspire service discovery within the ACA environment.

Smoke tested locally:
- docker build passes for both
- docker run pinwiz-web:smoke-test → GET /alive returns HTTP 200
@jkeeley2073 jkeeley2073 added the claude-code Generated with Claude Code label May 15, 2026
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
PinballWizard.Application 88% 81% 1184
PinballWizard.Web 74% 72% 513
PinballWizard.Api 84% 73% 69
PinballWizard.Infrastructure 66% 67% 1856
PinballWizard.Core 77% 100% 62
Summary 74% (7602 / 10238) 73% (2455 / 3367) 3684

Minimum allowed line rate is 70%

@jkeeley2073 jkeeley2073 merged commit 9431f7e into main May 15, 2026
9 checks passed
@jkeeley2073 jkeeley2073 deleted the Dev-Phase7-A1 branch May 15, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-code Generated with Claude Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant