#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
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["LiteFccCoreMain/LiteFccCoreMain.csproj", "LiteFccCoreMain/"]
COPY ["Devices/Pumps/HengShan_Pump_TQC_IFSF/HengShan_Pump_TQC_IFSF.csproj", "Devices/Pumps/HengShan_Pump_TQC_IFSF/"]
COPY ["Framework/Edge.Core/Edge.Core.csproj", "Framework/Edge.Core/"]
COPY ["Devices/Pumps/Wayne_Pump_Dart/Wayne_Pump_Dart.csproj", "Devices/Pumps/Wayne_Pump_Dart/"]
COPY ["Framework/Edge.WebHost/Edge.WebHost.csproj", "Framework/Edge.WebHost/"]
COPY ["Extension/Fdc/FdcServerHost/FdcServerHost.csproj", "Extension/Fdc/FdcServerHost/"]
COPY ["Extension/Fdc/FDCPOSInterfaceServer/FDCPOSInterfaceServer.csproj", "Extension/Fdc/FDCPOSInterfaceServer/"]
RUN dotnet restore "LiteFccCoreMain/LiteFccCoreMain.csproj"
COPY . .
WORKDIR "/src/LiteFccCoreMain"
RUN dotnet build "LiteFccCoreMain.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "LiteFccCoreMain.csproj" -c Release -o /app/publish

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