| 123456789101112131415161718192021222324252627282930313233 |
- FROM node:22-slim
- # Install FFmpeg + wget (for thumbnail generation and healthcheck)
- # DNS: 1.1.1.1 for fast DNS resolution; fallback to security.debian.org mirror
- RUN cat > /etc/resolv.conf <<EOF
- nameserver 1.1.1.1
- nameserver 8.8.8.8
- nameserver 8.26.56.26
- EOF
- RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg wget ca-certificates && rm -rf /var/lib/apt/lists/*
- WORKDIR /app
- # Copy package files and install
- COPY packages/api/package*.json ./
- COPY packages/api/prisma ./prisma
- COPY packages/api/tsconfig.json ./
- RUN npm install && rm -rf node_modules/@prisma/client && npx prisma generate
- # Copy source code
- COPY packages/api/src ./src
- # Build TypeScript
- RUN npx tsc -p tsconfig.json
- # Copy the worker JS files (pure JS, not compiled — run in forked child)
- COPY packages/api/src/worker ./src/worker
- EXPOSE 3001
- ENV NODE_ENV=production
- CMD ["node", "dist/index.js"]
|