diff --git a/.drone.yml b/.drone.yml index 74f4dc2..1f7efeb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: default steps: - name: build - image: registry.cn-hangzhou.aliyuncs.com/library/docker:latest + image: plugins/docker settings: dockerfile: Dockerfile dry_run: true diff --git a/Dockerfile b/Dockerfile index 9cd3414..38f4ed6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ # 构建阶段 -FROM registry.cn-hangzhou.aliyuncs.com/library/node:18-alpine AS builder +FROM node:18-alpine AS builder WORKDIR /app COPY package.json . COPY package-lock.json* . +# 设置npm镜像 RUN npm config set registry https://registry.npmmirror.com/ && \ npm install @@ -14,7 +15,7 @@ COPY . . RUN npm run build # 运行阶段 -FROM registry.cn-hangzhou.aliyuncs.com/library/node:18-alpine +FROM node:18-alpine WORKDIR /app @@ -22,6 +23,7 @@ COPY --from=builder /app/dist ./dist COPY --from=builder /app/package.json . COPY --from=builder /app/bootstrap.js . +# 设置npm镜像 RUN npm config set registry https://registry.npmmirror.com/ && \ npm install --production