-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (23 loc) · 859 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (23 loc) · 859 Bytes
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
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/HttpStatus/HttpStatus.csproj", "HttpStatus/"]
RUN dotnet restore "HttpStatus/HttpStatus.csproj"
COPY src .
WORKDIR "/src/HttpStatus"
RUN dotnet build "HttpStatus.csproj" -c Release -o /app/build
WORKDIR /tests
COPY ["tests/HttpStatusTests/HttpStatusTests.csproj", "HttpStatusTests/"]
RUN dotnet restore "HttpStatusTests/HttpStatusTests.csproj"
COPY tests .
WORKDIR "/tests/HttpStatusTests"
RUN Logging__LogLevel__HttpLoggingMiddlewareOverride=Warning dotnet test "HttpStatusTests.csproj"
FROM build AS publish
WORKDIR "/src/HttpStatus"
RUN dotnet publish "HttpStatus.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "HttpStatus.dll"]