Skip to content

Instantly share code, notes, and snippets.

@timheuer
Created October 28, 2022 02:11
Show Gist options
  • Save timheuer/b5d92b4f8b65d766b52e8e574bff925b to your computer and use it in GitHub Desktop.
Save timheuer/b5d92b4f8b65d766b52e8e574bff925b to your computer and use it in GitHub Desktop.
blazor-front-end-container
FROM nginx:latest AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["BlazorApp47/BlazorApp47.csproj", "BlazorApp47/"]
RUN dotnet restore "BlazorApp47/BlazorApp47.csproj"
COPY . .
WORKDIR "/src/BlazorApp47"
RUN dotnet build "BlazorApp47.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "BlazorApp47.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish/wwwroot /usr/share/nginx/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment