FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src
COPY ["/NPP.SmartSchedue.Host/NPP.SmartSchedue.Host.csproj", "/NPP.SmartSchedue.Host/NPP.SmartSchedue.Host.csproj"]
RUN dotnet restore "/NPP.SmartSchedue.Host/NPP.SmartSchedue.Host.csproj" -nowarn:NETSDK1138
COPY . .
WORKDIR "/src/NPP.SmartSchedue.Host"
ENV NUGET_XMLDOC_MODE none
RUN dotnet publish "NPP.SmartSchedue.Host.csproj" -nowarn:NETSDK1138 -c Release -o /app

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
COPY --from=publish /app .
EXPOSE 8000
ENTRYPOINT ["dotnet", "NPP.SmartSchedue.Host.dll"]