fix(leaderboard-service): 删除 Dockerfile 中的 test stage
问题:Dockerfile 中的 test stage 放在最后,导致 docker build 默认使用 test stage 而不是 production stage。容器启动时运行 npm test 而不是 node dist/src/main.js。 修复:删除 test stage,只保留 builder 和 production stages。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b224e209a6
commit
fc26575693
|
|
@ -49,27 +49,3 @@ EXPOSE 3000
|
|||
|
||||
# Start the application
|
||||
CMD ["node", "dist/src/main.js"]
|
||||
|
||||
# Test stage
|
||||
FROM node:20-alpine AS test
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install OpenSSL for Prisma
|
||||
RUN apk add --no-cache openssl
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
COPY prisma ./prisma/
|
||||
|
||||
# Install all dependencies (including devDependencies)
|
||||
RUN npm ci
|
||||
|
||||
# Generate Prisma client (dummy DATABASE_URL for build time only)
|
||||
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/db" npx prisma generate
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Default command for tests
|
||||
CMD ["npm", "test"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue