fix(docker): 修复 Dockerfile npm 构建错误并优化测试配置

- 修复 Dockerfile 使用 pnpm 替代 npm ci(适配 pnpm 迁移)
- 为 docker-compose-test.yml 添加自动构建配置
- 更新测试配置文档说明一键构建命令

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Jiahao Luo
2026-01-05 11:10:31 +08:00
parent a11a0f289c
commit 0f79c3cc0e
2 changed files with 13 additions and 6 deletions

View File

@@ -19,13 +19,16 @@ FROM ${NODE_IMAGE} AS frontend-builder
WORKDIR /app/frontend
# Install pnpm
RUN corepack enable && corepack prepare pnpm@latest --activate
# Install dependencies first (better caching)
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/package.json frontend/pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy frontend source and build
COPY frontend/ ./
RUN npm run build
RUN pnpm run build
# -----------------------------------------------------------------------------
# Stage 2: Backend Builder