File tree Expand file tree Collapse file tree 3 files changed +48
-8
lines changed
Expand file tree Collapse file tree 3 files changed +48
-8
lines changed Original file line number Diff line number Diff line change 1+ # ------------ Build stage ------------
2+ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
3+ WORKDIR /src
4+
5+ # Copy ApiIntegrationMvc + the SDKs it depends on
6+ COPY UserManagement.Contracts/UserManagement.Contracts.csproj UserManagement.Contracts/
7+ COPY CentralizedLogging.Contracts/CentralizedLogging.Contracts.csproj CentralizedLogging.Contracts/
8+ COPY UserManagement.Sdk/UserManagement.Sdk.csproj UserManagement.Sdk/
9+ COPY CentralizedLogging.Sdk/CentralizedLogging.Sdk.csproj CentralizedLogging.Sdk/
10+ COPY ApiIntegrationMvc/ApiIntegrationMvc.csproj ApiIntegrationMvc/
11+
12+ RUN dotnet restore ApiIntegrationMvc/ApiIntegrationMvc.csproj
13+
14+ COPY . .
15+ RUN dotnet publish ApiIntegrationMvc/ApiIntegrationMvc.csproj -c Release -o /app
16+
17+ # ------------ Runtime stage ------------
18+ FROM mcr.microsoft.com/dotnet/aspnet:9.0
19+ WORKDIR /app
20+
21+ # Install required libraries for Microsoft.Data.SqlClient on Linux
22+ RUN apt-get update && apt-get install -y \
23+ libkrb5-3 \
24+ libgssapi-krb5-2 \
25+ && rm -rf /var/lib/apt/lists/*
26+
27+ # Copy published output
28+ COPY --from=build /app ./
29+
30+ EXPOSE 8080
31+ EXPOSE 8081
32+
33+ # Replace with the actual assembly name if different
34+ ENTRYPOINT ["dotnet" , "ApiIntegrationMvc.dll" ]
Original file line number Diff line number Diff line change 22FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
33WORKDIR /src
44
5- COPY *.csproj ./
6- RUN dotnet restore
5+ # Copy CentralizedLoggingApi + the SDKs it depends on
6+ COPY CentralizedLogging.Contracts/CentralizedLogging.Contracts.csproj CentralizedLogging.Contracts/
7+ COPY CentralizedLoggingApi/CentralizedLoggingApi.csproj CentralizedLoggingApi/
78
8- COPY . ./
9- RUN dotnet publish -c Release -o /app
9+ RUN dotnet restore CentralizedLoggingApi/CentralizedLoggingApi.csproj
10+
11+ COPY . .
12+ RUN dotnet publish CentralizedLoggingApi/CentralizedLoggingApi.csproj -c Release -o /app
1013
1114# Runtime stage
1215FROM mcr.microsoft.com/dotnet/aspnet:9.0
Original file line number Diff line number Diff line change 22FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
33WORKDIR /src
44
5- COPY *.csproj ./
6- RUN dotnet restore
5+ # Copy UserManagementApi + the SDKs it depends on
6+ COPY UserManagement.Contracts/UserManagement.Contracts.csproj UserManagement.Contracts/
7+ COPY UserManagementApi/UserManagementApi.csproj UserManagementApi/
78
8- COPY . ./
9- RUN dotnet publish -c Release -o /app
9+ RUN dotnet restore UserManagementApi/UserManagementApi.csproj
10+
11+ COPY . .
12+ RUN dotnet publish UserManagementApi/UserManagementApi.csproj -c Release -o /app
1013
1114# Runtime stage
1215FROM mcr.microsoft.com/dotnet/aspnet:9.0
You can’t perform that action at this time.
0 commit comments