MHD011 commited on
Commit
ba84082
·
verified ·
1 Parent(s): 860265a

Upload 3 files

Browse files
Files changed (2) hide show
  1. Dockerfile +19 -14
  2. requirements.txt +2 -1
Dockerfile CHANGED
@@ -1,14 +1,19 @@
1
- FROM python:3.9-slim
2
-
3
- WORKDIR /app
4
-
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
-
8
- RUN mkdir -p /app/model_cache && chmod -R 777 /app/model_cache
9
- ENV TRANSFORMERS_CACHE=/app/model_cache
10
- ENV HF_HOME=/app/model_cache
11
-
12
- COPY . .
13
-
14
- CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # تثبيت التبعيات الأساسية أولاً
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ COPY requirements.txt .
11
+ RUN pip install --no-cache-dir -r requirements.txt gunicorn==20.1.0 # تأكيد تثبيت gunicorn
12
+
13
+ RUN mkdir -p /app/model_cache && chmod -R 777 /app/model_cache
14
+ ENV TRANSFORMERS_CACHE=/app/model_cache
15
+ ENV HF_HOME=/app/model_cache
16
+
17
+ COPY . .
18
+
19
+ CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--timeout", "600", "app:app"]
requirements.txt CHANGED
@@ -3,4 +3,5 @@ flask-cors>=3.0.0
3
  torch>=2.0.0
4
  transformers>=4.30.0
5
  accelerate
6
- huggingface-hub>=0.15.0
 
 
3
  torch>=2.0.0
4
  transformers>=4.30.0
5
  accelerate
6
+ huggingface-hub>=0.15.0
7
+ gunicorn>=20.1.0