-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
# Restore dotnet before build to allow for caching
WORKDIR /
COPY StyleCop.json ./
COPY CodeAnalysis.ruleset ./
COPY Skelvy.CodeAnalysis.targets ./
COPY src/Skelvy.WebAPI/Skelvy.WebAPI.csproj /src/Skelvy.WebAPI/
COPY src/Skelvy.Application/Skelvy.Application.csproj /src/Skelvy.Application/
COPY src/Skelvy.Domain/Skelvy.Domain.csproj /src/Skelvy.Domain/
COPY src/Skelvy.Common/Skelvy.Common.csproj /src/Skelvy.Common/
COPY src/Skelvy.Infrastructure/Skelvy.Infrastructure.csproj /src/Skelvy.Infrastructure/
COPY src/Skelvy.Persistence/Skelvy.Persistence.csproj /src/Skelvy.Persistence/
RUN dotnet restore /src/Skelvy.WebAPI/Skelvy.WebAPI.csproj
# Copy source files and build
COPY . ./
RUN dotnet build /src/Skelvy.WebAPI/Skelvy.WebAPI.csproj --no-restore -c Release
RUN dotnet publish /src/Skelvy.WebAPI/Skelvy.WebAPI.csproj --no-restore -c Release -o /app
# Copy compiled app to runtime container
FROM base AS final
COPY --from=build /app .
ENTRYPOINT ["dotnet", "Skelvy.WebAPI.dll"]