# Node 20（Debian bookworm），与 @napi-rs/canvas 等原生模块兼容较好
FROM node:20-bookworm-slim

WORKDIR /app

# 若 canvas 等依赖在部分环境下需编译，可取消下一行注释
# RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ && rm -rf /var/lib/apt/lists/*

COPY package.json package-lock.json ./
RUN npm ci --omit=dev

COPY . .

ENV NODE_ENV=production
EXPOSE 3000

USER node

CMD ["node", "src/server.js"]
