Update Dockerfile to use domestic mirrors for package installation and npm registry
This commit is contained in:
@@ -8,7 +8,10 @@ WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
|
||||
# 安装系统依赖(用于数据库编译)
|
||||
# 配置国内镜像源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
# 安装系统依赖(使用国内镜像源)
|
||||
RUN apk add --no-cache \
|
||||
sqlite \
|
||||
sqlite-dev \
|
||||
@@ -16,6 +19,9 @@ RUN apk add --no-cache \
|
||||
make \
|
||||
g++
|
||||
|
||||
# 配置npm使用国内镜像源
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
|
||||
# 复制package.json和package-lock.json(如果存在)
|
||||
COPY package*.json ./
|
||||
|
||||
|
||||
Reference in New Issue
Block a user