diff --git a/Dockerfile b/Dockerfile index 1c0922d..b2e6d6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,29 @@ -FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +FROM mcr.microsoft.com/dotnet/sdk:10.0 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/aspnet:10.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG TARGETARCH -ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 \ - NUGET_XMLDOC_MODE=skip +ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 +ENV NUGET_XMLDOC_MODE=skip WORKDIR /app_source # 1. Copy everything over COPY . . -# 2. Restore all projects using the solution context (This works perfectly) +# 2. Prevent exit code 155 (global.json version mismatch) +RUN rm -f global.json + +# 3. Restore all projects using the solution context RUN dotnet restore "PostFundManagement.slnx" -# 3. Move directly to the publish stage (Skipping the broken dotnet build step) +# 4. Move directly to the publish stage 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 +# 5. Final runtime assembly FROM base AS final WORKDIR /app COPY --from=publish /app/publish .