Multi-stage backend/Dockerfile (sdk build -> aspnet:10.0 runtime, ~312MB) + docker-compose.prod.yml, additive only — not wired into CI or the existing dev docker-compose.yml (which keeps the SDK image for dotnet run hot-reload). New .dockerignore keeps the build context lean (node_modules alone is ~750MB) since the Dockerfile COPYs from the repo root to pick up public/letter.css (WP-25's FE<->BE letter contract) as a sibling of backend/. Verified for real: built the image, ran it, and curled a live GET /api/v1/brief/preview against the running container — got back the actual rendered letter HTML with letter.css inlined, confirming the walk-up-from-BaseDirectory lookup resolves inside this image layout too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
16 lines
694 B
Docker
16 lines
694 B
Docker
# WP-30: lean deployable image (optional — not used by the dev demo, which keeps the SDK
|
|
# image in the root docker-compose.yml for `dotnet run` hot-reload). Build from the repo
|
|
# root: `docker build -f backend/Dockerfile .`
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
WORKDIR /src
|
|
COPY . .
|
|
RUN dotnet publish backend/src/BigRegister.Api -c Release -o /app
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
|
WORKDIR /app
|
|
COPY --from=build /app .
|
|
# LetterHtml.Render (WP-25) walks up from AppContext.BaseDirectory looking for a sibling
|
|
# public/letter.css (the FE⇄BE letter contract) — this keeps that lookup working here too.
|
|
COPY public ./public
|
|
ENTRYPOINT ["dotnet", "BigRegister.Api.dll"]
|