File size: 1,444 Bytes
a2dd162
e4ce572
a2dd162
 
 
 
e4ce572
 
80a25de
 
e4ce572
80a25de
e4ce572
 
 
80a25de
e4ce572
 
 
80a25de
e4ce572
 
 
 
 
 
 
 
a2dd162
e4ce572
 
 
 
 
 
80a25de
a2dd162
 
e4ce572
a2dd162
e4ce572
 
 
 
a2dd162
e4ce572
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# المرحلة الأولى: جلب الكود وبناؤه
FROM node:22-slim AS builder

# تثبيت git لجلب المستودع
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# جلب المشروع من فرع محدد (inex-style)
RUN git clone -b feature/inex-style-redesign-1892825162429981884 https://github.com/AmmarBasha2011/QuranVideoGeneratorAPI.git .

# تثبيت الاعتماديات وبناء المشروع
RUN npm install
RUN npm run build

# المرحلة الثانية: التشغيل
FROM node:22-slim
WORKDIR /app

# تثبيت FFmpeg والخطوط العربية
RUN apt-get update && apt-get install -y \
    ffmpeg \
    fonts-dejavu-core \
    fonts-freefont-ttf \
    fonts-noto-core \
    fonts-noto-ui-core \
    && rm -rf /var/lib/apt/lists/*

# نسخ الملفات من مرحلة البناء
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/client/dist ./client/dist
COPY --from=builder /app/assets ./assets
COPY --from=builder /app/free-photo-of-holy-quran-under-sunlight.webp ./

# إنشاء المجلدات وضبط الصلاحيات
RUN mkdir -p outputs temp assets/backgrounds && \
    chmod -R 777 /app/outputs /app/temp /app/assets

# تثبيت مكتبات التشغيل فقط
RUN npm install --omit=dev

ENV PORT=7860
ENV NODE_ENV=production
EXPOSE 7860

CMD ["node", "dist/index.js"]