Mark-Lasfar commited on
Commit
2d126ba
·
1 Parent(s): 19abece

Update Model

Browse files
Files changed (2) hide show
  1. Dockerfile +15 -15
  2. requirements.txt +0 -1
Dockerfile CHANGED
@@ -1,10 +1,9 @@
1
- # استخدام صورة PyTorch مع CUDA
2
- FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-devel
3
 
4
- # تحديث pip
5
- RUN pip install --upgrade pip
6
 
7
- # تثبيت الـ dependencies المطلوبة لـ ffmpeg و chromium-driver
8
  RUN apt-get update && apt-get install -y \
9
  chromium-driver \
10
  git \
@@ -13,26 +12,27 @@ RUN apt-get update && apt-get install -y \
13
  ffmpeg \
14
  && apt-get clean && rm -rf /var/lib/apt/lists/*
15
 
16
- # تحديد مجلد العمل
17
- WORKDIR /app
18
 
19
- # نسخ requirements.txt
20
- COPY requirements.txt .
21
 
22
- # تثبيت الـ dependencies
 
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # إنشاء /data مع الصلاحيات
26
  RUN mkdir -p /data && chmod -R 755 /data
27
 
28
- # نسخ باقي الملفات
29
  COPY . .
30
 
31
- # التحقق من الملفات
32
  RUN ls -R /app
33
 
34
- # تعريض المنفذ 7860 لـ FastAPI
35
  EXPOSE 7860
36
 
37
- # تشغيل التطبيق
38
  CMD ["python", "main.py"]
 
1
+ FROM python:3.10-slim
 
2
 
3
+ # Set working directory
4
+ WORKDIR /app
5
 
6
+ # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  chromium-driver \
9
  git \
 
12
  ffmpeg \
13
  && apt-get clean && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Update pip
16
+ RUN pip install --upgrade pip
17
 
18
+ # Install torch first to avoid dependency conflicts
19
+ RUN pip install packaging torch==2.4.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
20
 
21
+ # Copy requirements.txt and install dependencies
22
+ COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ # Create /data directory with correct permissions
26
  RUN mkdir -p /data && chmod -R 755 /data
27
 
28
+ # Copy all project files
29
  COPY . .
30
 
31
+ # Verify files in /app
32
  RUN ls -R /app
33
 
34
+ # Expose port 7860 for FastAPI
35
  EXPOSE 7860
36
 
37
+ # Run the FastAPI app
38
  CMD ["python", "main.py"]
requirements.txt CHANGED
@@ -26,7 +26,6 @@ urllib3==2.0.7
26
  itsdangerous
27
  protobuf==3.19.6
28
  fastapi-users[sqlalchemy,oauth2]>=14.0.0
29
- flash-attn==2.6.3 # حددت إصدار محدد لتجنب مشاكل التوافق
30
  sqlalchemy>=2.0.35
31
  python-jose[cryptography]>=3.3.0
32
  passlib[bcrypt]>=1.7.4
 
26
  itsdangerous
27
  protobuf==3.19.6
28
  fastapi-users[sqlalchemy,oauth2]>=14.0.0
 
29
  sqlalchemy>=2.0.35
30
  python-jose[cryptography]>=3.3.0
31
  passlib[bcrypt]>=1.7.4