-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
29 lines (21 loc) · 967 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
29
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
WORKDIR /srv
COPY Fragment.NetSlum.sln .
COPY src/. src/.
RUN dotnet restore src/Fragment.NetSlum.Server
FROM build as testrunner
COPY test/. test/.
RUN dotnet test -c Release --filter "Category=Unit" /p:CollectCoverage=true /p:ExcludeByFile="**/Migrations/*.cs" /p:CoverletOutput='/test/build/' /p:CoverletOutputFormat='json%2ccobertura' /p:MergeWith='/test/build/coverage.json'
FROM build AS publish
WORKDIR /srv/src/Fragment.NetSlum.Server
RUN dotnet publish Fragment.NetSlum.Server.csproj -c Release --runtime linux-x64 -o /app --self-contained
WORKDIR /srv/src/Fragment.NetSlum.Console
RUN dotnet publish Fragment.NetSlum.Console.csproj -c Release --runtime linux-x64 -o /app/console --self-contained
FROM base AS final
EXPOSE 49000
WORKDIR /app
COPY --from=publish /app .
CMD ["./Fragment.NetSlum.Server"]