FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src # Install CA certificates for custom NuGet source RUN apt-get update && \ apt-get install -y --no-install-recommends ca-certificates && \ update-ca-certificates && \ rm -rf /var/lib/apt/lists/* # Copy nuget.config (copied to submodule root by CI/CD) COPY nuget.config /root/.nuget/NuGet/NuGet.Config COPY . . # Publish directly (restore + build + publish in one step) WORKDIR "/src/src/Nocr.TextMatcher.Migrator" RUN dotnet publish "Nocr.TextMatcher.Migrator.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=build /app/publish . ENTRYPOINT ["dotnet", "Nocr.TextMatcher.Migrator.dll"]