fix: route all Docker builds through local Nexus mirrors

- All Node Dockerfiles rewritten with NODE_IMAGE + NPM_REGISTRY build args
  defaulting to local Nexus proxies (171.22.25.73:5000/library/node:20-alpine
  and http://mirror:8081/repository/npm-group/)
- Add extra_hosts: mirror:host-gateway to every build section so the
  mirror hostname resolves during docker build
- Replace nuget.org with nuget.docker.config (Nexus mirror) in api/admin-api
  Dockerfiles to fix NuGet restore in Iranian network
- Rewrite admin-web and website Dockerfiles (were referencing non-existent
  meezi-node:20-alpine base image with no npm install step)
- Update dotnet image defaults to 171.22.25.73:5002 MCR proxy in admin-api
  and docker-compose.admin.yml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-05-28 21:01:43 +03:30
parent 25154f9dd9
commit 979dcaa949
9 changed files with 95 additions and 50 deletions
+3 -9
View File
@@ -1,21 +1,18 @@
# Base images: override via docker-compose build args or .env (see docs/DOCKER.md).
# Default = Microsoft Container Registry (official). Docker Hub dotnet/* often returns
# "insufficient_scope" unless logged in, or is unreachable in some regions.
ARG DOTNET_SDK_IMAGE=mcr.microsoft.com/dotnet/sdk:10.0
ARG DOTNET_ASPNET_IMAGE=mcr.microsoft.com/dotnet/aspnet:10.0
FROM ${DOTNET_SDK_IMAGE} AS build
WORKDIR /src
COPY global.json Directory.Build.props Directory.Packages.props nuget.config ./
COPY global.json Directory.Build.props Directory.Packages.props ./
# nuget.docker.config points to local Nexus mirror (mirror:8081 via extra_hosts in compose)
COPY nuget.docker.config ./nuget.config
COPY src/Meezi.Shared/Meezi.Shared.csproj src/Meezi.Shared/
COPY src/Meezi.Core/Meezi.Core.csproj src/Meezi.Core/
COPY src/Meezi.Infrastructure/Meezi.Infrastructure.csproj src/Meezi.Infrastructure/
COPY src/Meezi.API/Meezi.API.csproj src/Meezi.API/
# NuGet over TLS often fails in Docker when VPN/filter/antivirus breaks HTTPS (bad record mac).
# Retry via nuget.config; offline revocation helps restricted networks. Re-run build if restore fails.
ENV NUGET_CERT_REVOCATION_MODE=offline
RUN --mount=type=cache,target=/root/.nuget/packages \
dotnet restore src/Meezi.API/Meezi.API.csproj --disable-parallel
@@ -28,9 +25,6 @@ RUN dotnet publish src/Meezi.API/Meezi.API.csproj -c Release -o /app/publish /p:
FROM ${DOTNET_ASPNET_IMAGE} AS runtime
WORKDIR /app
# No apt-get here — avoids Ubuntu mirror downloads during build (Iran/VPN issues).
# Healthcheck uses a TCP probe (see docker-compose.yml).
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080