Merge pull request 'Simplified fpm-api dockerfile' (#67) from garages3 into main
Reviewed-on: #67
This commit was merged in pull request #67.
This commit is contained in:
@@ -1,32 +1,20 @@
|
|||||||
# Base image for running the app
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet: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
|
||||||
|
|
||||||
# Build stage
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
|
||||||
|
|
||||||
# Copy full source tree
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN ls -lth
|
|
||||||
|
|
||||||
# Restore the entire solution
|
|
||||||
RUN dotnet restore PostFundManagement.slnx
|
RUN dotnet restore PostFundManagement.slnx
|
||||||
|
|
||||||
# Force build output to standard output using the classic logger and explicit error dumping
|
WORKDIR ./PostFundManagement.Api
|
||||||
RUN dotnet build /b1 "./PostFundManagement.Api/PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
RUN ls -lth
|
||||||
|
|
||||||
# Publish stage
|
RUN dotnet publish PostFundManagement.Api.csproj -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||||
FROM build AS publish
|
|
||||||
ARG BUILD_CONFIGURATION=Release
|
|
||||||
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 .
|
COPY --from=publish /app/publish .
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "PostFundManagement.Api.dll"]
|
ENTRYPOINT ["dotnet", "PostFundManagement.Api.dll"]
|
||||||
Reference in New Issue
Block a user