chore: 项目基线提交 - 拼豆图纸生成器 V1.0 核心代码

- 前端: React+Vite 首页/AI专区, 算法库(MARD色板/量化/背景去除), API对接
- 后端: Express+SQLite, 兑换码/订单/支付/chibi生成, 风控+云端同步
- CI/CD: GitHub Actions + Docker + nginx 配置
- 文档: PRD/DESIGN/LAUNCH/ROADMAP/E2E/竞品对照等 15 份
- 工程: 任务看板(taskboard) + 健康巡检(agent-health) + Git流程(gitflow)
This commit is contained in:
Sisyphus (主代理) committed 2026-08-13 21:40:27 +08:00
commit 02762400fb
174 files changed
+28059

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
# syntax=docker/dockerfile:1
# =============================================================================
# PERLER LAB — 前端 Dockerfile(多阶段构建)
# 构建阶段:node:20-alpine + Vite 构建 React 应用 → dist/
# 运行阶段:nginx:alpine 提供静态资源服务(SPA 路由回退由 nginx.conf 处理)
# =============================================================================
# ── 第一阶段:构建 ──
FROM node:20-alpine AS build
WORKDIR /app
# 复制依赖清单(有 package-lock.json,使用 npm ci 保证可复现)
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund
# 复制 Vite/TS 配置与 HTML 入口
COPY tsconfig.json vite.config.ts index.html ./
# 复制源码与静态资源(public/ 由 Vite 在构建时合并进 dist/)
COPY src ./src
COPY public ./public
# 构建 React 应用 → dist/(与 package.json 的 build 脚本一致:vite build)
RUN npm run build
# ── 第二阶段:Nginx 运行 ──
FROM nginx:1.27-alpine
# 复制 nginx 配置
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 复制构建产物(dist/ 含 index.html + assets/)到 nginx 根目录
COPY --from=build /app/dist /usr/share/nginx/html
# 健康检查
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=10s \
CMD wget -qO- http://localhost:80/healthz || exit 1
EXPOSE 80