c9839b265c
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 22s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 51s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 56s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 2m51s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 3m4s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 3m33s
AI Code Review / AI Code Review (pull_request) Successful in 4m5s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m28s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Successful in 4m49s
Preview Cleanup / Cleanup Preview Environment (pull_request) Failing after 1s
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Failing after 1439h29m12s
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Failing after 1439h29m15s
CI Build & Deploy Pipeline / Deploy Production (pull_request) Failing after 1439h29m14s
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Failing after 1439h29m15s
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Failing after 1439h29m16s
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1439h29m16s
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Failing after 1439h29m17s
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Failing after 1439h29m17s
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Failing after 1440h1m17s
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Failing after 1440h1m18s
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Failing after 1440h1m19s
- 移除node_modules的cache mount,改为写入镜像layer走ACR缓存 - 保留/root/.npm cache mount加速下载(不影响正确性) - 保留.tscache cache mount加速TS增量编译(坏了不影响构建) - layer缓存由ACR跨runner共享,内容完整性由layer哈希保证
35 lines
1.3 KiB
Docker
Executable File
35 lines
1.3 KiB
Docker
Executable File
# Build stage
|
|
FROM git.xiaoxiajianji.com/xiaoxia/base/node:20 AS builder
|
|
WORKDIR /app
|
|
ARG VITE_API_URL=https://saas-api.xiaoxiajianji.com
|
|
ENV VITE_API_URL=$VITE_API_URL
|
|
|
|
# 先拷依赖清单(缓存友好:依赖不变时直接命中缓存层)
|
|
COPY apps/web/package.json apps/web/package-lock.json ./apps/web/
|
|
WORKDIR /app/apps/web
|
|
|
|
# 安装依赖:node_modules写入镜像layer,走ACR缓存保证完整性
|
|
# /root/.npm 保留cache mount加速下载(不影响构建正确性)
|
|
RUN --mount=type=cache,target=/root/.npm,sharing=locked \
|
|
npm config set registry https://registry.npmmirror.com \
|
|
&& npm ci
|
|
|
|
# 再拷源码
|
|
COPY apps/web/ ./
|
|
|
|
# 构建:TS增量编译 + Vite构建,tsbuildinfo用cache mount持久化
|
|
# node_modules直接使用镜像中已安装的(layer缓存保证完整性)
|
|
RUN --mount=type=cache,target=/app/apps/web/.tscache,sharing=locked \
|
|
mkdir -p .tscache \
|
|
&& npx tsc --incremental --tsBuildInfoFile .tscache/tsconfig.tsbuildinfo \
|
|
&& npx vite build
|
|
|
|
# Production stage with nginx
|
|
FROM git.xiaoxiajianji.com/xiaoxia/base/nginx:alpine AS runner
|
|
ARG NGINX_CONF=infra/docker/nginx.conf
|
|
WORKDIR /usr/share/nginx/html
|
|
COPY --from=builder /app/apps/web/dist ./
|
|
COPY ${NGINX_CONF} /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|