FROM node:20 AS node_base # Set the working directory WORKDIR /app FROM node_base AS node_modules # Copy the package.json and package-lock.json COPY package*.json ./ # Install the dependencies RUN npm install FROM node_base AS build # Copy the source code COPY . . FROM build AS runtime # Copy the node_modules COPY --from=node_modules /app/node_modules ./node_modules # Expose the port EXPOSE 3000 # generate prisma client RUN npm run prisma:generate # Start the application CMD ["npm", "run", "start:dev"]