You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
469 B
Docker
20 lines
469 B
Docker
5 years ago
|
FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build
|
||
|
WORKDIR /app
|
||
|
|
||
|
# copy csproj and restore as distinct layers
|
||
|
COPY *.sln .
|
||
|
COPY aspnetapp/*.csproj ./aspnetapp/
|
||
|
RUN dotnet restore
|
||
|
|
||
|
# copy everything else and build app
|
||
|
COPY aspnetapp/. ./aspnetapp/
|
||
|
WORKDIR /app/aspnetapp
|
||
|
RUN dotnet publish -c Release -o out
|
||
|
|
||
|
|
||
|
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime
|
||
|
EXPOSE 80
|
||
|
WORKDIR /app
|
||
|
COPY --from=build /app/aspnetapp/out ./
|
||
|
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
|