fix:更新cicd

This commit is contained in:
Your Name 2026-06-22 15:13:55 +08:00
parent fc939ab672
commit 39058aeaeb

View File

@ -1,34 +1,23 @@
# 构建阶段 # 构建阶段
FROM crpi-jlsdxetsdmy4ckxh.cn-shenzhen.personal.cr.aliyuncs.com/zsq_proxy/node:20-alpine AS build FROM crpi-jlsdxetsdmy4ckxh.cn-shenzhen.personal.cr.aliyuncs.com/zsq_proxy/node:22-alpine AS build
WORKDIR /app WORKDIR /app
# 添加构建参数 # 关键:切换 Alpine 软件源到阿里云(大幅提升下载速度)
ARG BUILD_VERSION RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
ARG BUILD_TIME
ARG CACHE_BUST
ENV BUILD_VERSION=$BUILD_VERSION
ENV BUILD_TIME=$BUILD_TIME
# 强制打破 Docker 缓存
RUN echo "Cache bust: ${CACHE_BUST} - ${BUILD_VERSION} - ${BUILD_TIME}"
RUN yarn config set registry https://registry.npmmirror.com && \ RUN yarn config set registry https://registry.npmmirror.com && \
yarn config set network-timeout 60000 yarn config set network-timeout 60000
COPY package*.json ./ COPY package*.json yarn.lock ./
RUN yarn install --frozen-lockfile RUN yarn install --frozen-lockfile
COPY . . COPY . .
# 强制清理 .next # 构建(跳过 ESLint 和类型检查)
RUN rm -rf .next RUN yarn build --no-lint --no-typescript
# 构建
RUN yarn build
# 部署阶段 # 部署阶段
FROM crpi-jlsdxetsdmy4ckxh.cn-shenzhen.personal.cr.aliyuncs.com/zsq_proxy/node:20-alpine AS app FROM crpi-jlsdxetsdmy4ckxh.cn-shenzhen.personal.cr.aliyuncs.com/zsq_proxy/node:22-alpine AS production
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production