#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016 AS base
WORKDIR /app
EXPOSE 51257
EXPOSE 44386
FROM microsoft/dotnet:2.1-sdk-nanoserver-sac2016 AS build
WORKDIR /src
COPY ["TrainingContest.Web/TrainingContest.Web.csproj", "TrainingContest.Web/"]
COPY ["TrainingContest.Data/TrainingContest.Data.csproj", "TrainingContest.Data/"]
RUN dotnet restore "TrainingContest.Web/TrainingContest.Web.csproj"
COPY . .
WORKDIR "/src/TrainingContest.Web"
RUN dotnet build "TrainingContest.Web.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "TrainingContest.Web.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "TrainingContest.Web.dll"]