Use better image for building aspnet core app

This commit is contained in:
NicolasDorier 2017-09-29 13:22:00 +09:00
parent 72f6b7863c
commit 669d54aab2

View File

@ -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"]