api-server/Dockerfile.worker
WangDL 33f1cc1859
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 1m1s
feat: P2 infrastructure — Docker Compose, shutdown hooks, Prisma migration
- B20: docker-compose.yml with MySQL 8.0, Redis 7, API, BullMQ Worker, Nginx
- B20: Dockerfile.worker + worker.module.ts + worker.main.ts for standalone worker
- B20: nginx/nginx.conf reverse proxy with gzip, /api/* routes, health check
- B21: app.enableShutdownHooks() in main.ts for graceful SIGTERM handling
- B22: migration adding objectKey/bucket to UploadedFile, AiUsageLog, WaitlistEntry

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 10:50:59 +08:00

30 lines
568 B
Docker

FROM node:22-alpine AS builder
WORKDIR /app
RUN apk add --no-cache openssl
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json tsconfig.build.json nest-cli.json ./
COPY prisma ./prisma
COPY src ./src
RUN npx prisma generate
RUN npm run build
RUN npm prune --production
FROM node:22-alpine
WORKDIR /app
RUN apk add --no-cache openssl
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/package.json ./
CMD ["node", "dist/worker.main.js"]