#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.BalanceSheet4K/Bailun.DC.BalanceSheet4K.csproj", "Bailun.DC.BalanceSheet4K/"]
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.BalanceSheet4K/Bailun.DC.BalanceSheet4K.csproj"
COPY . .
WORKDIR "/src/Bailun.DC.BalanceSheet4K"
RUN dotnet build "Bailun.DC.BalanceSheet4K.csproj" -c Release -o /app/build

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

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