# --- Build Aşaması --- FROM node:20-alpine AS builder WORKDIR /usr/src/app COPY backend/package*.json ./ RUN npm install -g npm@latest RUN npm ci COPY backend . RUN npm run build # --- Prod Image --- FROM node:20-alpine AS production WORKDIR /usr/src/app ENV NODE_ENV=production COPY --from=builder /usr/src/app/dist ./dist COPY --from=builder /usr/src/app/node_modules ./node_modules USER node EXPOSE 3000 CMD ["node", "dist/main.js"]