-
Notifications
You must be signed in to change notification settings - Fork 65
YARP WithStaticFiles + WithDockerfile: missing docs on required /wwwroot path in Docker image #476
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:
- That
WithStaticFiles()expects files at/wwwrootinside the container - 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- That the Dockerfile must use the YARP base image (
mcr.microsoft.com/dotnet/nightly/yarp) as its final stage sodotnet /app/yarp.dllcan 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 deployto Azure Container Apps