-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
31 lines (23 loc) · 940 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
30
31
# Base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
# Build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
COPY *.sln ./
COPY RelationshipAnalysis/*.csproj ./RelationshipAnalysis/
COPY RelationAnalysis.Migrations/*.csproj ./RelationAnalysis.Migrations/
COPY RelationshipAnalysis.Test/*.csproj ./RelationshipAnalysis.Test/
COPY RelationshipAnalysis.Integration.Test/*.csproj ./RelationshipAnalysis.Integration.Test/
RUN dotnet restore RelationshipAnalysis.sln
COPY . ./
RUN dotnet test && \
dotnet clean && \
dotnet build RelationshipAnalysis.sln -c Release -o build
RUN dotnet publish RelationshipAnalysis.sln -c Release -o publish
FROM base AS final
COPY --from=build /app/publish .
COPY --from=build /app/build/RelationAnalysis.Migrations.dll ./RelationAnalysis.Migrations.dll
ENV ASPNETCORE_URLS=http://*:80
ENV ASPNETCORE_ENVIRONMENT=Development
CMD ["dotnet", "RelationshipAnalysis.dll"]