#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
WORKDIR /app
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["Bailun.DC.MonthShippingIncoming/Bailun.DC.MonthShippingIncoming.csproj", "Bailun.DC.MonthShippingIncoming/"]
COPY ["Bailun.DC.Common/Bailun.DC.Common.csproj", "Bailun.DC.Common/"]
COPY ["Bailun.DC.Models/Bailun.DC.Models.csproj", "Bailun.DC.Models/"]
RUN dotnet restore "Bailun.DC.MonthShippingIncoming/Bailun.DC.MonthShippingIncoming.csproj"
COPY . .
WORKDIR "/src/Bailun.DC.MonthShippingIncoming"
RUN dotnet build "Bailun.DC.MonthShippingIncoming.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Bailun.DC.MonthShippingIncoming.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Bailun.DC.MonthShippingIncoming.dll"]
