From cd395dd3ed09ad8b6276dc05fbe21ce8a32e46c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 02:11:21 +0000 Subject: [PATCH 1/2] Initial plan From 9b3514436e76f346b0621710e73e4ae5fa9220ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 02:19:28 +0000 Subject: [PATCH 2/2] docs: add WithStaticFiles + WithDockerfile documentation for YARP /wwwroot path requirement Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../docs/integrations/reverse-proxies/yarp.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/reverse-proxies/yarp.mdx b/src/frontend/src/content/docs/integrations/reverse-proxies/yarp.mdx index c1e88e626..af30f7e21 100644 --- a/src/frontend/src/content/docs/integrations/reverse-proxies/yarp.mdx +++ b/src/frontend/src/content/docs/integrations/reverse-proxies/yarp.mdx @@ -174,6 +174,24 @@ var frontend = builder.AddYarp("frontend") .WithDockerfile("../npmapp"); ``` +When using `WithStaticFiles()` together with `WithDockerfile()`, the YARP container expects static files to be placed at the `/wwwroot` directory inside the container. Your Dockerfile must use the YARP base image (`mcr.microsoft.com/dotnet/nightly/yarp`) as its final stage so the YARP server can start and serve the files. The following example shows a multi-stage Dockerfile that builds a Node.js frontend app and copies the output to `/wwwroot`: + +```dockerfile title="Dockerfile" +FROM node:22-slim AS build +WORKDIR /app +COPY package*.json ./ +RUN npm ci +COPY . . +RUN npm run build + +FROM mcr.microsoft.com/dotnet/nightly/yarp +COPY --from=build /app/dist /wwwroot +``` + + + #### Combining static files with routing You can combine static file serving with dynamic routing: