refactor(mirror): replace 3 services with single Nexus Repository Manager

Consolidates BaGet + Verdaccio + registry:2 into one Sonatype Nexus OSS
instance with a REST API provisioning script.

docker-compose.mirror.yml: single nexus service, ports 8081 (UI/NuGet/npm)
  and 8083 (Docker Hub pull-through proxy)
mirrors/nexus/provision.sh: idempotent setup — changes admin password,
  enables anonymous access, creates nuget-proxy / npm-proxy / docker-hub-proxy
nuget.mirror.config: updated source URL to Nexus NuGet proxy endpoint
ci-cd.yml: updated npm --registry to Nexus npm proxy endpoint

Run once on server: docker compose -f docker-compose.mirror.yml up -d
  then: ./mirrors/nexus/provision.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-05-28 14:35:55 +03:30
parent 6f85cfe4d3
commit 61e44c63ab
4 changed files with 210 additions and 87 deletions
+4 -4
View File
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- NuGet config for CI: routes all restores through the local BaGet mirror.
<!-- NuGet config for CI: routes all restores through the local Nexus mirror.
Usage: dotnet restore --configfile nuget.mirror.config
BaGet fetches from nuget.org on first request, then caches locally.
DO NOT use this file for local development (mirror must be running). -->
Nexus fetches from nuget.org on first request, then caches locally.
DO NOT use for local development (mirror must be running on the server). -->
<configuration>
<packageSources>
<clear />
<add key="local-mirror" value="http://mirror:5101/v3/index.json" protocolVersion="3" />
<add key="nexus-nuget" value="http://mirror:8081/repository/nuget-proxy/index.json" protocolVersion="3" />
</packageSources>
<config>
<add key="http_retry_count" value="8" />