FROM microsoft/dotnet:2.1-runtime-alpine AS base
WORKDIR /app
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

FROM microsoft/dotnet:2.1-sdk-alpine AS build
WORKDIR /src
COPY Bailun.DC.SaveSkuDeliverWeighDiff/Bailun.DC.SaveSkuDeliverWeighDiff.csproj Bailun.DC.SaveSkuDeliverWeighDiff/
RUN dotnet restore Bailun.DC.SaveSkuDeliverWeighDiff/Bailun.DC.SaveSkuDeliverWeighDiff.csproj
COPY . .
WORKDIR /src/Bailun.DC.SaveSkuDeliverWeighDiff
RUN dotnet build Bailun.DC.SaveSkuDeliverWeighDiff.csproj -c Release -o /app

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

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