From 77be8412211cc162dfeb75fbf70f7b6017ab62d9 Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Thu, 29 Jan 2026 02:44:55 +0330 Subject: [PATCH] fix: Add NuGet.config for package source configuration and update restore command in Dockerfile --- Dockerfile | 7 +++++-- src/NuGet.config | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/NuGet.config diff --git a/Dockerfile b/Dockerfile index a62d6b2..68dcb91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build WORKDIR /src +# Copy NuGet config first +COPY src/NuGet.config ./ + # Copy solution and project files COPY src/ ./ -# Restore and publish -RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" +# Restore with Nexus config and publish +RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" --configfile NuGet.config RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish --no-restore FROM 194.5.195.53:32082/dotnet/aspnet:9.0 AS runtime diff --git a/src/NuGet.config b/src/NuGet.config new file mode 100644 index 0000000..a5af54d --- /dev/null +++ b/src/NuGet.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file