From 669d54aab2b0b3ea3d44c480683270bb7305e701 Mon Sep 17 00:00:00 2001 From: NicolasDorier Date: Fri, 29 Sep 2017 13:22:00 +0900 Subject: [PATCH] Use better image for building aspnet core app --- BTCPayServer/DockerFile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/DockerFile b/BTCPayServer/DockerFile index a6701621e..807a1e469 100644 --- a/BTCPayServer/DockerFile +++ b/BTCPayServer/DockerFile @@ -1,9 +1,13 @@ -FROM microsoft/dotnet:2.0.0-sdk as builder -WORKDIR /app +FROM microsoft/aspnetcore-build AS builder +WORKDIR /source + # caches restore result by copying csproj file separately +COPY *.csproj . +RUN dotnet restore +# copies the rest of your code COPY . . -RUN dotnet publish -c Release +RUN dotnet publish --output /app/ --configuration Release FROM microsoft/aspnetcore:2.0.0 WORKDIR /app -COPY --from=builder "/app/bin/Release/netcoreapp2.0/publish" . +COPY --from=builder "/app" . ENTRYPOINT ["dotnet", "BTCPayServer.dll"] \ No newline at end of file