AmmarBasha2011 commited on
Commit
668d864
·
verified ·
1 Parent(s): 665d560

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +47 -0
Dockerfile ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # المرحلة الأولى: جلب الكود وبناؤه
2
+ FROM node:22-slim AS builder
3
+
4
+ # تثبيت git لجلب المستودع
5
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
+
7
+ WORKDIR /app
8
+
9
+ # جلب المشروع من فرع محدد (inex-style)
10
+ RUN git clone -b feature/inex-style-redesign-1892825162429981884 https://github.com/AmmarBasha2011/QuranVideoGeneratorAPI.git .
11
+
12
+ # تثبيت الاعتماديات وبناء المشروع
13
+ RUN npm install
14
+ RUN npm run build
15
+
16
+ # المرحلة الثانية: التشغيل
17
+ FROM node:22-slim
18
+ WORKDIR /app
19
+
20
+ # تثبيت FFmpeg والخطوط العربية
21
+ RUN apt-get update && apt-get install -y \
22
+ ffmpeg \
23
+ fonts-dejavu-core \
24
+ fonts-freefont-ttf \
25
+ fonts-noto-core \
26
+ fonts-noto-ui-core \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
+ # نسخ الملفات من مرحلة البناء
30
+ COPY --from=builder /app/package*.json ./
31
+ COPY --from=builder /app/dist ./dist
32
+ COPY --from=builder /app/client/dist ./client/dist
33
+ COPY --from=builder /app/assets ./assets
34
+ COPY --from=builder /app/free-photo-of-holy-quran-under-sunlight.webp ./
35
+
36
+ # إنشاء المجلدات وضبط الصلاحيات
37
+ RUN mkdir -p outputs temp assets/backgrounds && \
38
+ chmod -R 777 /app/outputs /app/temp /app/assets
39
+
40
+ # تثبيت مكتبات التشغيل فقط
41
+ RUN npm install --omit=dev
42
+
43
+ ENV PORT=7860
44
+ ENV NODE_ENV=production
45
+ EXPOSE 7860
46
+
47
+ CMD ["node", "dist/index.js"]