Revert: Back to nginx for Blazor WASM

This commit is contained in:
masoud
2025-12-06 23:11:01 +00:00
parent f689a95ddd
commit 17f8346a87

View File

@@ -1,7 +1,3 @@
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 ["BackOffice/NuGet.config", "NuGet.config"]
@@ -9,14 +5,20 @@ COPY ["BackOffice/BackOffice.csproj", "BackOffice/"]
RUN dotnet restore "BackOffice/BackOffice.csproj" --configfile NuGet.config
COPY . .
WORKDIR "/src/BackOffice"
RUN dotnet build "./BackOffice.csproj" -c Release -o /app/build
RUN dotnet publish "./BackOffice.csproj" -c Release -o /app/publish
FROM build AS publish
RUN dotnet publish "./BackOffice.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_URLS=http://+:8080
ENTRYPOINT ["dotnet", "BackOffice.dll"]
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 _;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}
NGINX_CONF
EXPOSE 80