-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
35 lines (28 loc) · 1.21 KB
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
32
33
34
35
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/Domain/Domain.csproj", "Domain/"]
COPY ["src/Application/Application.csproj", "Application/"]
COPY ["src/Infrastructure/Infrastructure.csproj", "Infrastructure/"]
COPY ["src/Client/Client.csproj", "Client/"]
RUN dotnet restore "Domain/Domain.csproj"
RUN dotnet restore "Application/Application.csproj"
RUN dotnet restore "Infrastructure/Infrastructure.csproj"
RUN dotnet restore "Client/Client.csproj"
COPY src/. .
RUN dotnet build "Domain/Domain.csproj" -c $BUILD_CONFIGURATION --no-restore
RUN dotnet build "Application/Application.csproj" -c $BUILD_CONFIGURATION --no-restore
RUN dotnet build "Infrastructure/Infrastructure.csproj" -c $BUILD_CONFIGURATION --no-restore
RUN dotnet build "Client/Client.csproj" -c $BUILD_CONFIGURATION --no-restore
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Client/Client.csproj" --no-build --no-restore -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Client.dll"]