Garages3 #70
@@ -1,11 +1,11 @@
|
|||||||
# Stage 1: Runtime base
|
# Stage 1: Runtime base
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||||
USER app
|
USER app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Stage 2: Build & Restore
|
# Stage 2: Build & Restore
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
@@ -16,17 +16,19 @@ COPY ["PostFundManagement.Domain/PostFundManagement.Domain.csproj", "PostFundMan
|
|||||||
COPY ["PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj", "PostFundManagement.Infrastructure/"]
|
COPY ["PostFundManagement.Infrastructure/PostFundManagement.Infrastructure.csproj", "PostFundManagement.Infrastructure/"]
|
||||||
|
|
||||||
# Restore packages
|
# Restore packages
|
||||||
RUN dotnet restore "./PostFundManagement.Api/PostFundManagement.Api.csproj"
|
RUN dotnet restore "PostFundManagement.Api/PostFundManagement.Api.csproj"
|
||||||
|
|
||||||
# Copy full source code and build
|
# Copy full source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Build from the project folder using relative filename
|
||||||
WORKDIR "/src/PostFundManagement.Api"
|
WORKDIR "/src/PostFundManagement.Api"
|
||||||
RUN dotnet build "./PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
RUN dotnet build "PostFundManagement.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||||
|
|
||||||
# Stage 3: Publish
|
# Stage 3: Publish
|
||||||
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.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
# Stage 4: Final Runtime
|
# Stage 4: Final Runtime
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
|
|||||||
Reference in New Issue
Block a user