Skip to content

docs: document YARP WithStaticFiles + WithDockerfile /wwwroot path requirement#505

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-yarp-docker-docs
Draft

docs: document YARP WithStaticFiles + WithDockerfile /wwwroot path requirement#505
Copilot wants to merge 2 commits intomainfrom
copilot/update-yarp-docker-docs

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Users combining WithStaticFiles() and WithDockerfile() on a YARP resource get silent 404s because nothing documents that static files must live at /wwwroot inside the container or that the final Dockerfile stage must use the YARP base image.

Adds to the existing "Static file serving" section in the YARP integration page:

  • Explanation that the YARP container expects built assets at /wwwroot
  • Complete multi-stage Dockerfile example (Node.js build → YARP base image):
    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
  • Caution aside surfacing the The WebRootPath was not found: /wwwroot log message as a diagnostic hint

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js dev --host 0.0.0.0 (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js dev --port 4322 (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/aspire.dev/aspire.dev/src/frontend/node_modules/.bin/../astro/astro.js dev --port 4323 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>YARP WithStaticFiles + WithDockerfile: missing docs on required /wwwroot path in Docker image</issue_title>
<issue_description>## Bug Description

When using AddYarp("frontend").WithStaticFiles().WithDockerfile("./frontend"), there is no documentation explaining that the YARP container expects static files at /wwwroot. Users must write a multi-stage Dockerfile that copies built assets to /wwwroot using the mcr.microsoft.com/dotnet/nightly/yarp base image, but this is not documented anywhere.

Current Behavior

A user creates a Dockerfile that builds frontend assets (e.g., Vite/React) but doesn't know where to place the output. The container starts successfully but returns 404 for all requests. The only clue is a log line: The WebRootPath was not found: /wwwroot. Static files may be unavailable.

Expected Behavior

The YARP integration docs should document:

  1. That WithStaticFiles() expects files at /wwwroot inside the container
  2. A complete example Dockerfile showing the required multi-stage build pattern, e.g.:
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
  1. That the Dockerfile must use the YARP base image (mcr.microsoft.com/dotnet/nightly/yarp) as its final stage so dotnet /app/yarp.dll can run

Page URL

The YARP hosting integration page (if it exists) or the general deployment docs.

Additional Context

  • Aspire version: 13.3.0-pr.14149.g4bc5e9bf (all packages)
  • .NET SDK: 10.0.100
  • OS: macOS (Darwin arm64)
  • Discovered during aspire deploy to Azure Container Apps
    </issue_description>

<agent_instructions>Please use the https://github.com/microsoft/aspire.dev/blob/main/.github/skills/doc-writer/SKILL.md skill to address issue..</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…wroot path requirement

Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot AI changed the title [WIP] Update YARP documentation for static files path in Docker docs: document YARP WithStaticFiles + WithDockerfile /wwwroot path requirement Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YARP WithStaticFiles + WithDockerfile: missing docs on required /wwwroot path in Docker image

2 participants