diff --git a/backend/services/identity-service/Dockerfile b/backend/services/identity-service/Dockerfile index 02c6ce26..5875576e 100644 --- a/backend/services/identity-service/Dockerfile +++ b/backend/services/identity-service/Dockerfile @@ -5,6 +5,12 @@ # Build stage - use Alpine for smaller build context FROM node:20-alpine AS builder +# Use Aliyun mirror for Alpine packages (China acceleration) +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + +# Use taobao npm registry (China acceleration) +RUN npm config set registry https://registry.npmmirror.com + WORKDIR /app # Copy package files @@ -35,12 +41,19 @@ FROM node:20-slim WORKDIR /app +# Use Aliyun mirror for Debian packages (China acceleration) +RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \ + sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list 2>/dev/null || true + # Install OpenSSL and curl for health checks RUN apt-get update && apt-get install -y --no-install-recommends \ openssl \ curl \ && rm -rf /var/lib/apt/lists/* +# Use taobao npm registry (China acceleration) +RUN npm config set registry https://registry.npmmirror.com + # Install production dependencies only COPY package*.json ./ RUN npm ci --only=production