979dcaa949
- 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>
43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
ARG NODE_IMAGE=node:20-alpine
|
|
|
|
FROM ${NODE_IMAGE} AS deps
|
|
WORKDIR /app
|
|
COPY web/admin/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 NEXT_PUBLIC_ADMIN_API_URL=http://localhost:5081
|
|
ENV NEXT_PUBLIC_ADMIN_API_URL=$NEXT_PUBLIC_ADMIN_API_URL
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY web/admin/ .
|
|
RUN npm run build
|
|
|
|
FROM ${NODE_IMAGE} AS runner
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV HOSTNAME=0.0.0.0
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
RUN addgroup --system --gid 1001 nodejs \
|
|
&& adduser --system --uid 1001 nextjs
|
|
|
|
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
|
|
|
|
USER nextjs
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"]
|