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:
+18
-14
@@ -1,23 +1,30 @@
|
||||
FROM meezi-node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
ARG NODE_IMAGE=node:20-alpine
|
||||
|
||||
COPY web/website/ .
|
||||
FROM ${NODE_IMAGE} AS deps
|
||||
WORKDIR /app
|
||||
COPY web/website/package*.json ./
|
||||
ARG NPM_REGISTRY=https://registry.npmjs.org
|
||||
# Install deps then ensure Alpine (musl) SWC binary is present
|
||||
RUN npm install --legacy-peer-deps --ignore-scripts --registry ${NPM_REGISTRY} \
|
||||
&& NEXT_VER=$(node -e "process.stdout.write(require('./node_modules/next/package.json').version)") \
|
||||
&& ls node_modules/@next/swc-linux-x64-musl 2>/dev/null \
|
||||
|| npm install --no-save --ignore-scripts --registry ${NPM_REGISTRY} \
|
||||
"@next/swc-linux-x64-musl@${NEXT_VER}"
|
||||
|
||||
FROM ${NODE_IMAGE} AS builder
|
||||
WORKDIR /app
|
||||
|
||||
ARG MEEZI_API_URL=http://api:8080
|
||||
ENV MEEZI_API_URL=$MEEZI_API_URL
|
||||
|
||||
ARG NEXT_PUBLIC_SITE_URL=http://localhost:3010
|
||||
ENV NEXT_PUBLIC_SITE_URL=$NEXT_PUBLIC_SITE_URL
|
||||
|
||||
RUN NEXT_VER=$(node -e "process.stdout.write(require('./node_modules/next/package.json').version)") \
|
||||
&& rm -rf node_modules/@next/swc-win32-* node_modules/@next/swc-darwin-* 2>/dev/null; \
|
||||
ls node_modules/@next/swc-linux-x64-musl 2>/dev/null \
|
||||
|| npm install --no-save --ignore-scripts "@next/swc-linux-x64-musl@${NEXT_VER}"
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY web/website/ .
|
||||
RUN npm run build
|
||||
|
||||
FROM meezi-node:20-alpine AS runner
|
||||
FROM ${NODE_IMAGE} AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
@@ -31,11 +38,8 @@ RUN addgroup --system --gid 1001 nodejs \
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
# Blog MDX content is read at runtime by process.cwd()
|
||||
COPY --from=builder /app/src/content ./src/content
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
Reference in New Issue
Block a user