#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/runtime:3.1 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["GreenTree.Firefly.Importer/GreenTree.Firefly.Importer.csproj", "GreenTree.Firefly.Importer/"]
RUN dotnet restore "GreenTree.Firefly.Importer/GreenTree.Firefly.Importer.csproj"
COPY . .
WORKDIR "/src/GreenTree.Firefly.Importer"
RUN dotnet build "GreenTree.Firefly.Importer.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "GreenTree.Firefly.Importer.csproj" -c Release -o /app/publish

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