-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
28 lines (24 loc) · 971 Bytes
/
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
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY ["Pitch.Card.API/Pitch.Card.API.csproj", "Pitch.Card.API/"]
COPY ["Pitch.Card.API.Tests/Pitch.Card.API.Tests.csproj", "Pitch.Card.API.Tests/"]
RUN dotnet restore "Pitch.Card.API/Pitch.Card.API.csproj"
RUN dotnet restore "Pitch.Card.API.Tests/Pitch.Card.API.Tests.csproj"
COPY . .
WORKDIR "/src/Pitch.Card.API"
RUN dotnet build "Pitch.Card.API.csproj" -c Release -o /app
FROM build AS testrunner
WORKDIR /src/Pitch.Card.API.Tests
COPY Pitch.Card.API.Tests/. .
ENTRYPOINT ["dotnet", "test"]
CMD ["--logger:trx", "/p:CollectCoverage=true", "/p:CoverletOutputFormat=cobertura", "/p:CoverletOutput=./TestResults/"]
FROM build AS publish
RUN dotnet publish "Pitch.Card.API.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Pitch.Card.API.dll"]