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 ./ # Enable legacy peer deps RUN npm config set legacy-peer-deps true # 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 # Generate the Prisma client RUN npm run prisma:generate # Expose the port EXPOSE 3000 # Start the application CMD ["npm", "run", "start:dev"]