fix(reward-service): 修复 Dockerfile 使用 Debian slim 和正确的 CMD 路径

- Builder 阶段从 node:20-alpine 改为 node:20-slim
- 修复 CMD 路径从 dist/main.js 改为 dist/src/main.js
- 添加构建输出验证步骤

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Developer 2025-12-02 07:16:20 -08:00
parent a503bda266
commit bb989bd80f
1 changed files with 9 additions and 4 deletions

View File

@ -2,11 +2,16 @@
# Reward Service Dockerfile
# =============================================================================
# Build stage
FROM node:20-alpine AS builder
# Build stage - use Debian slim for better Prisma compatibility
FROM node:20-slim AS builder
WORKDIR /app
# Install OpenSSL for Prisma
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
&& rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
COPY tsconfig*.json ./
@ -26,7 +31,7 @@ COPY src ./src
RUN npm run build
# Verify build output exists
RUN ls -la dist/ && test -f dist/main.js
RUN ls -la dist/src/ && test -f dist/src/main.js
# Production stage - use Debian slim for OpenSSL compatibility
FROM node:20-slim
@ -67,4 +72,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3005/health || exit 1
# Start service
CMD ["node", "dist/main.js"]
CMD ["node", "dist/src/main.js"]