Skip to content

Commit 4374b9b

Browse files
A new dockerfile for user management api added and the docker-decompose file updated
1 parent d9fb0a8 commit 4374b9b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

UserManagementApi/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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"]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)