Files
xiaoxia-saas/infra/docker/web.Dockerfile
T
xiaoxia 9768b7434a
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 37s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 45s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m11s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 958h36m40s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 958h36m40s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 958h36m42s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 958h36m44s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 958h36m44s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 959h10m4s
fix(ci): 修复npm registry配置 + package-lock.json同步 + pro套餐测试
- web.Dockerfile: 移除npm config set registry,改用--registry内联参数;
  npx tsc/vite build改为./node_modules/.bin/直接调用
- preview-deploy.yml: 同上,移除全局npm config set registry
- step_frontend_install.sh: 移除全局npm config set registry,改用--registry内联
- package-lock.json: 重新生成,补全@testing-library/dom等缺失包
- test_wave78_duplication_domain.py: test_all_tiers_exist添加pro套餐
2026-08-07 16:50:15 +08:00

34 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 ci --registry=https://registry.npmmirror.com
# 再拷源码
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 \
&& ./node_modules/.bin/tsc --incremental --tsBuildInfoFile .tscache/tsconfig.tsbuildinfo \
&& ./node_modules/.bin/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;"]