Fix: Revert to aspnet runtime for Blazor Server with gRPC
This commit is contained in:
@@ -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
|
||||
WORKDIR /src
|
||||
COPY ["FrontOffice.Main/NuGet.config", "NuGet.config"]
|
||||
@@ -5,20 +9,14 @@ COPY ["FrontOffice.Main/FrontOffice.Main.csproj", "FrontOffice.Main/"]
|
||||
RUN dotnet restore "FrontOffice.Main/FrontOffice.Main.csproj" --configfile NuGet.config
|
||||
COPY . .
|
||||
WORKDIR "/src/FrontOffice.Main"
|
||||
RUN dotnet publish "./FrontOffice.Main.csproj" -c Release -o /app/publish
|
||||
RUN dotnet build "./FrontOffice.Main.csproj" -c Release -o /app/build
|
||||
|
||||
FROM nginx:alpine AS final
|
||||
WORKDIR /usr/share/nginx/html
|
||||
COPY --from=build /app/publish/wwwroot .
|
||||
COPY <<'NGINX_CONF' /etc/nginx/conf.d/default.conf
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "./FrontOffice.Main.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
NGINX_CONF
|
||||
EXPOSE 80
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
ENTRYPOINT ["dotnet", "FrontOffice.Main.dll"]
|
||||
|
||||
Reference in New Issue
Block a user