othmanezaid77 commited on
Commit
5c29424
·
verified ·
1 Parent(s): 16cdb8a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -6
Dockerfile CHANGED
@@ -1,17 +1,25 @@
1
- FROM python:3.10-slim
 
2
 
3
- # تنصيب الأدوات اللازمة لبناء المكتبات
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
- python3-dev \
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /code
10
 
11
- COPY ./requirements.txt /code/requirements.txt
12
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
13
 
14
  COPY . .
15
 
16
- # تشغيل السيرفر على البورت 7860
 
 
17
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # استعملنا نسخة فيها الأدوات واجدة
2
+ FROM python:3.10
3
 
4
+ # تنصيب المتطلبات الأساسية للنظام
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
+ cmake \
8
+ git \
9
+ libopenblas-dev \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  WORKDIR /code
13
 
14
+ # تثبيت المكتبات (درناهم هنا باش نضمنو السرعة)
15
+ RUN pip install --no-cache-dir fastapi uvicorn requests
16
+
17
+ # تثبيت llama-cpp بطريقة تضمن الـ Build
18
+ RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python
19
 
20
  COPY . .
21
 
22
+ # البورت اللي كيبغيه Hugging Face
23
+ EXPOSE 7860
24
+
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]