From 08dd95a9865b85b138eda9c4a34fcb1542ce4e50 Mon Sep 17 00:00:00 2001 From: ruberoid Date: Tue, 14 Oct 2025 15:00:11 +0400 Subject: [PATCH] Simplify Dockerfile: use dotnet nuget add source API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced manual NuGet.Config creation (20 lines) with simple API call (1 line): - dotnet nuget add source for custom Gitea feed - No API key needed for public read access - Much cleaner and more maintainable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/Nocr.TelegramListener.Host/Dockerfile | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/Nocr.TelegramListener.Host/Dockerfile b/src/Nocr.TelegramListener.Host/Dockerfile index 3e9e4ae..53fd47f 100644 --- a/src/Nocr.TelegramListener.Host/Dockerfile +++ b/src/Nocr.TelegramListener.Host/Dockerfile @@ -16,25 +16,10 @@ RUN apt-get update && \ COPY . . -# Create NuGet.Config with package source mapping to avoid NU1507 warnings -RUN mkdir -p /root/.nuget/NuGet && \ - echo '' > /root/.nuget/NuGet/NuGet.Config && \ - echo '' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo ' ' >> /root/.nuget/NuGet/NuGet.Config && \ - echo '' >> /root/.nuget/NuGet/NuGet.Config +# Add custom NuGet source (no API key needed for public read access) +RUN dotnet nuget add source https://gitea.musk.fun/api/packages/nocr/nuget/index.json --name musk -# Restore with verbose logging to see what's happening +# Restore with verbose logging RUN dotnet restore "src/Nocr.TelegramListener.Host/Nocr.TelegramListener.Host.csproj" --verbosity normal WORKDIR "/src/src/Nocr.TelegramListener.Host" RUN dotnet build "Nocr.TelegramListener.Host.csproj" -c Release -o /app/build