AnesKAM commited on
Commit
5a020ab
·
verified ·
1 Parent(s): 9eb0671

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -2
Dockerfile CHANGED
@@ -1,8 +1,26 @@
1
- FROM python:3.10-slim
 
2
 
 
3
  WORKDIR /app
4
- COPY . /app
5
 
 
 
 
 
 
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
 
 
 
 
 
 
 
 
 
 
8
  CMD ["python", "app.py"]
 
1
+ # استخدم صورة Python رسمية
2
+ FROM python:3.9-slim
3
 
4
+ # تعيين دليل العمل
5
  WORKDIR /app
 
6
 
7
+ # تثبيت الأدوات الإضافية المطلوبة
8
+ RUN apt-get update && apt-get install -y \
9
+ sqlite3 \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # نسخ ملف المتطلبات أولاً (للاستفادة من caching)
13
+ COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # نسخ باقي الملفات
17
+ COPY . .
18
+
19
+ # إنشاء قاعدة البيانات وجلب أخبار أولية
20
+ RUN python init_db.py
21
+
22
+ # فتح المنفذ
23
+ EXPOSE 7860
24
+
25
+ # تشغيل التطبيق
26
  CMD ["python", "app.py"]