- 添加完整的 Docker 配置 (Dockerfile, docker-compose.yml) - 修复前端硬编码端口 4000,改用相对路径 /api - 实现多 OCR 提供商架构 (Tesseract.js/Baidu/RapidOCR) - 修复 Docker 环境中图片上传路径问题 - 添加用户设置页面和 AI 分析服务 - 更新 Prisma schema 支持 AI 分析结果 - 添加部署文档和 OCR 配置指南 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
906 B
Docker
43 lines
906 B
Docker
# ========================================
|
|
# Stage 1: Dependencies
|
|
# ========================================
|
|
FROM node:20-alpine AS deps
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# ========================================
|
|
# Stage 2: Builder
|
|
# ========================================
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
# Build the application (skip type check for production)
|
|
RUN npx vite build
|
|
|
|
# ========================================
|
|
# Stage 3: Runner with Nginx
|
|
# ========================================
|
|
FROM nginx:alpine AS runner
|
|
|
|
# Copy built assets from builder
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy custom nginx config
|
|
COPY nginx.docker.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Expose port
|
|
EXPOSE 80
|
|
|
|
# Start nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|