Rewrite pfm-api docker file
This commit is contained in:
+8
-4
@@ -1,25 +1,29 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
||||
FROM ://microsoft.com AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
# Optional: Keep only if your API build explicitly requires Node compilation tasks
|
||||
FROM node:22-bookworm-slim AS node
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
FROM ://microsoft.com AS build
|
||||
ARG TARGETARCH
|
||||
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \
|
||||
NUGET_XMLDOC_MODE=skip
|
||||
WORKDIR /app_source
|
||||
|
||||
# 1. Copy everything over
|
||||
COPY . .
|
||||
|
||||
WORKDIR "/app_source"
|
||||
RUN dotnet build "PostFundManagement.slnx" -c Release 1>&2
|
||||
# 2. Restore all projects using the solution context (This works perfectly)
|
||||
RUN dotnet restore "PostFundManagement.slnx"
|
||||
|
||||
# 3. Move directly to the publish stage (Skipping the broken dotnet build step)
|
||||
FROM build AS publish
|
||||
WORKDIR "/app_source/PostFundManagement.Api"
|
||||
RUN dotnet publish "PostFundManagement.Api.csproj" -c Release --no-restore -o /app/publish
|
||||
|
||||
# 4. Final runtime assembly
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
|
||||
Reference in New Issue
Block a user