FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /source
EXPOSE 80

# copy csproj and restore as distinct layers
COPY Listrr/Listrr.csproj .
RUN dotnet restore "Listrr.csproj" -r linux-arm64

# copy and publish app and libraries
COPY Listrr/ .
RUN dotnet publish -c release -o /app -r linux-arm64 --self-contained false --no-restore

# final stage/image
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm64v8
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./dotnetapp"]