# Use a lightweight Node.js image FROM node:20-slim # Install OpenSSL (required for Prisma) RUN apt-get update -y && apt-get install -y openssl # Set working directory WORKDIR /app # Copy package files first for better caching COPY package*.json ./ # Install dependencies (including production ones) RUN npm install # Copy Prisma schema COPY prisma ./prisma/ # Generate Prisma Client RUN npx prisma generate # Copy the rest of the application code COPY . . # Set environment to production ENV NODE_ENV=production # The CMD to run the worker script # We use tsx to run the typescript file directly. # Using 'npx tsx' is fine, or we can use the installed binary. CMD ["npx", "tsx", "src/scripts/worker.ts"]