Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikus1993 committed Apr 23, 2021
1 parent eb795e4 commit 46c0b75
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/DevNews.WebApp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0.202 AS build
WORKDIR /src
COPY . .
RUN dotnet tool restore
ENV PATH="/root/.dotnet/tools:${PATH}"

WORKDIR /src/src/DevNews.WebApp
RUN dotnet paket restore
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet build -c Release -o /app

FROM build as unittests
WORKDIR /src/tests/DevNews.Core.UnitTests
RUN dotnet restore -nowarn:msb3202,nu1503
RUN dotnet run

FROM build AS publish
RUN dotnet publish --no-restore -c Release -o /app

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

0 comments on commit 46c0b75

Please sign in to comment.