FROM node:20-alpine WORKDIR /app # Required for Prisma on Alpine RUN apk add --no-cache openssl # Install all deps (including devDeps for tsx worker runtime + build tooling) COPY package*.json ./ COPY prisma ./prisma RUN npm ci # Copy source COPY . . # Generate Prisma client and build Next.js (postinstall handles prisma generate) RUN npm run build ENV NODE_ENV=production EXPOSE 3000 # Default: run web server. Worker container overrides this CMD. CMD ["npm", "start"]