# المرحلة الأولى: مرحلة البناء (Builder Stage) FROM node:18-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN npm run build # --- # المرحلة الثانية: مرحلة الإنتاج (Production Stage) FROM node:18-alpine WORKDIR /app # ✅ **التعديل: تحديث قائمة الحزم أولاً ثم تثبيت postgresql-client** RUN apk update && apk add --no-cache postgresql-client # نسخ الملفات النهائية من مرحلة البناء COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package.json ./package.json COPY --from=builder /app/.next ./.next COPY --from=builder /app/public ./public EXPOSE 3000 CMD ["npm", "start"]