# Playwright 官方镜像（含 Chromium 与系统依赖），RPA Worker 生产环境必需
FROM mcr.microsoft.com/playwright:v1.61.0-jammy

WORKDIR /app

COPY package.json package-lock.json* ./
RUN npm ci

COPY . .
RUN npx prisma generate

ENV NODE_ENV=production
# 镜像已预装浏览器，禁止重复下载
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

CMD ["npm", "run", "worker:rpa"]
