Moved api dockerfile to project folder

This commit is contained in:
2026-09-13 18:07:32 +02:00
parent 4b658bdfd5
commit 2a8d72963d
3 changed files with 34 additions and 37 deletions
+33
View File
@@ -0,0 +1,33 @@
# Base image for running the app
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
# Copy project file from the current directory context
COPY ["PostFundManagement.Api.csproj", "./"]
# Restore dependencies
RUN dotnet restore "PostFundManagement.Api.csproj"
# Copy the remaining source code in PostFundManagement.Api
COPY . .
# Build the API project
RUN dotnet build "PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
# Publish stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Final runtime stage
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "PostFundManagement.Api.dll"]