DarkMo0o commited on
Commit
bc35817
·
verified ·
1 Parent(s): 23410c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -3
Dockerfile CHANGED
@@ -1,7 +1,26 @@
1
- FROM python:3.10
 
 
 
 
 
 
 
 
2
  WORKDIR /workspace
 
 
3
  COPY requirements.txt .
4
- RUN pip install --upgrade pip && pip install -r requirements.txt
 
 
 
5
  COPY app.py .
 
 
 
 
6
  EXPOSE 7860
7
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # تثبيت المكتبات الأساسية
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ wget \
7
+ git \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
  WORKDIR /workspace
11
+
12
+ # نسخ وتثبيت المتطلبات
13
  COPY requirements.txt .
14
+ RUN pip install --no-cache-dir --upgrade pip && \
15
+ pip install --no-cache-dir -r requirements.txt
16
+
17
+ # نسخ الكود
18
  COPY app.py .
19
+
20
+ # تحميل النموذج مسبقاً (اختياري - يوفر الوقت عند البدء)
21
+ RUN python -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('facebook/nllb-200-distilled-600M')"
22
+
23
  EXPOSE 7860
24
+
25
+ # تشغيل الخادم مع 4 workers للأداء الأفضل
26
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]