FROM node:20-slim AS base WORKDIR /app COPY package*.json ./ FROM base AS dependencies RUN npm install FROM dependencies AS build COPY . . RUN npm run build # Production stage FROM base AS release COPY --from=dependencies /app/node_modules ./node_modules COPY --from=build /app/dist ./dist CMD ["node", "dist/index.js"]