Fix: Revert to aspnet runtime for Blazor Server with gRPC

This commit is contained in:
masoud
2025-12-06 23:08:08 +00:00
parent ef4e2b5964
commit f689a95ddd

View File

@@ -1,3 +1,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src WORKDIR /src
COPY ["BackOffice/NuGet.config", "NuGet.config"] COPY ["BackOffice/NuGet.config", "NuGet.config"]
@@ -5,20 +9,14 @@ COPY ["BackOffice/BackOffice.csproj", "BackOffice/"]
RUN dotnet restore "BackOffice/BackOffice.csproj" --configfile NuGet.config RUN dotnet restore "BackOffice/BackOffice.csproj" --configfile NuGet.config
COPY . . COPY . .
WORKDIR "/src/BackOffice" WORKDIR "/src/BackOffice"
RUN dotnet publish "./BackOffice.csproj" -c Release -o /app/publish RUN dotnet build "./BackOffice.csproj" -c Release -o /app/build
FROM nginx:alpine AS final FROM build AS publish
WORKDIR /usr/share/nginx/html RUN dotnet publish "./BackOffice.csproj" -c Release -o /app/publish /p:UseAppHost=false
COPY --from=build /app/publish/wwwroot .
COPY <<'NGINX_CONF' /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name _;
location / { FROM base AS final
root /usr/share/nginx/html; WORKDIR /app
try_files $uri $uri/ /index.html; COPY --from=publish /app/publish .
}
} ENV ASPNETCORE_URLS=http://+:8080
NGINX_CONF ENTRYPOINT ["dotnet", "BackOffice.dll"]
EXPOSE 80