Fixed dockerfile paths #50

Merged
khwezi merged 1 commits from garages3 into main 2026-09-13 17:56:19 +02:00
Showing only changes of commit 9945b773db - Show all commits
+5 -8
View File
@@ -1,6 +1,5 @@
#FROM mcr.microsoft.com/dotnet/sdk:10.0 AS base
# Base image for running the app # Base image for running the app
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS base FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app WORKDIR /app
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081 EXPOSE 8081
@@ -11,7 +10,6 @@ ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
# Copy project files for dependency restoration # Copy project files for dependency restoration
# Copying all layer csproj files optimizes Docker layer caching
COPY ["PostFundManagement.Api/PostFundManagement.Api.csproj", "PostFundManagement.Api/"] COPY ["PostFundManagement.Api/PostFundManagement.Api.csproj", "PostFundManagement.Api/"]
COPY ["PostFundManagement.Application/PostFundManagement.Application.csproj", "PostFundManagement.Application/"] COPY ["PostFundManagement.Application/PostFundManagement.Application.csproj", "PostFundManagement.Application/"]
COPY ["PostFundManagement.Domain/PostFundManagement.Domain.csproj", "PostFundManagement.Domain/"] COPY ["PostFundManagement.Domain/PostFundManagement.Domain.csproj", "PostFundManagement.Domain/"]
@@ -23,17 +21,16 @@ RUN dotnet restore "PostFundManagement.Api/PostFundManagement.Api.csproj"
# Copy the remaining source code # Copy the remaining source code
COPY . . COPY . .
# Build the API project # Build the API project directly from /src context
WORKDIR "/src/PostFundManagement.Api" RUN dotnet build "PostFundManagement.Api/PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
RUN dotnet build "PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
# Publish stage # Publish stage
FROM build AS publish FROM build AS publish
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false RUN dotnet publish "PostFundManagement.Api/PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Final runtime stage # Final runtime stage
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "PostFundManagement.Api.dll"] ENTRYPOINT ["dotnet", "PostFundManagement.Api.dll"]