Merge pull request 'Fixed dockerfile paths' (#50) from garages3 into main
Reviewed-on: #50
This commit was merged in pull request #50.
This commit is contained in:
+5
-8
@@ -1,6 +1,5 @@
|
||||
#FROM mcr.microsoft.com/dotnet/sdk:10.0 AS base
|
||||
# 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
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
@@ -11,7 +10,6 @@ ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
|
||||
# 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.Application/PostFundManagement.Application.csproj", "PostFundManagement.Application/"]
|
||||
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 . .
|
||||
|
||||
# Build the API project
|
||||
WORKDIR "/src/PostFundManagement.Api"
|
||||
RUN dotnet build "PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
# Build the API project directly from /src context
|
||||
RUN dotnet build "PostFundManagement.Api/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
|
||||
RUN dotnet publish "PostFundManagement.Api/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"]
|
||||
ENTRYPOINT ["dotnet", "PostFundManagement.Api.dll"]
|
||||
Reference in New Issue
Block a user