File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ # Dockerfile
2+ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
3+ WORKDIR /src
4+
5+ COPY *.csproj ./
6+ RUN dotnet restore
7+
8+ COPY . ./
9+ RUN dotnet publish -c Release -o /app
10+
11+ # Runtime stage
12+ FROM mcr.microsoft.com/dotnet/aspnet:9.0
13+ WORKDIR /app
14+
15+ # Install required libraries for Microsoft.Data.SqlClient on Linux
16+ RUN apt-get update && apt-get install -y \
17+ libkrb5-3 \
18+ libgssapi-krb5-2 \
19+ && rm -rf /var/lib/apt/lists/*
20+
21+ COPY --from=build /app .
22+
23+ EXPOSE 6000
24+ EXPOSE 6001
25+
26+ ENTRYPOINT ["dotnet" , "UserManagementApi.dll" ]
Original file line number Diff line number Diff line change @@ -12,6 +12,19 @@ services:
1212 volumes :
1313 - ./CentralizedLoggingApi/logs:/app/logs
1414
15+ userapi :
16+ build : ./UserManagementApi
17+ container_name : user_management_api
18+ environment :
19+ - ASPNETCORE_ENVIRONMENT=Production
20+ ports :
21+ - " 6000:8080" # Host 6000 -> container 8080 (HTTP)
22+ # - "6001:8081" # Optional HTTPS mapping if your app listens on 8081
23+ depends_on :
24+ - db
25+ volumes :
26+ - ./UserManagementApi/logs:/app/logs
27+
1528 db :
1629 image : mcr.microsoft.com/mssql/server:2022-latest
1730 container_name : centralized_logging_db
You can’t perform that action at this time.
0 commit comments