Spaces:
Sleeping
Sleeping
- Dockerfile +8 -10
Dockerfile
CHANGED
|
@@ -1,32 +1,30 @@
|
|
| 1 |
-
# Base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# تثبيت الأدوات
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
gcc g++ python3-dev libopenblas-dev cmake build-essential \
|
| 7 |
-
libatlas-base-dev liblapack-dev libblas-dev
|
|
|
|
| 8 |
|
| 9 |
-
# مستخدم غير root
|
| 10 |
RUN useradd -m -u 1000 user
|
| 11 |
WORKDIR /home/user/app
|
| 12 |
COPY --chown=user . .
|
| 13 |
|
|
|
|
| 14 |
RUN mkdir -p /home/user/app/data/cache && chown -R user:user /home/user/app/data
|
| 15 |
|
| 16 |
-
# إنشاء
|
| 17 |
RUN python -m venv /home/user/venv
|
| 18 |
ENV PATH="/home/user/venv/bin:$PATH"
|
| 19 |
ENV FORCE_CMAKE=1
|
| 20 |
-
ENV CMAKE_ARGS="-DGGML_CUDA=
|
| 21 |
|
| 22 |
-
# تثبيت المتطلبات
|
| 23 |
RUN pip install --upgrade pip
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
-
RUN pip install --no-cache-dir python-dotenv
|
| 26 |
RUN pip install --no-cache-dir llama-cpp-python==0.3.9
|
| 27 |
|
| 28 |
USER user
|
| 29 |
|
| 30 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# تثبيت الأدوات الأساسية مع pkg-config
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
gcc g++ python3-dev libopenblas-dev cmake build-essential \
|
| 6 |
+
libatlas-base-dev liblapack-dev libblas-dev pkg-config \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# إضافة مستخدم غير root
|
| 10 |
RUN useradd -m -u 1000 user
|
| 11 |
WORKDIR /home/user/app
|
| 12 |
COPY --chown=user . .
|
| 13 |
|
| 14 |
+
# مجلد التخزين المؤقت للنموذج
|
| 15 |
RUN mkdir -p /home/user/app/data/cache && chown -R user:user /home/user/app/data
|
| 16 |
|
| 17 |
+
# إنشاء البيئة الافتراضية
|
| 18 |
RUN python -m venv /home/user/venv
|
| 19 |
ENV PATH="/home/user/venv/bin:$PATH"
|
| 20 |
ENV FORCE_CMAKE=1
|
| 21 |
+
ENV CMAKE_ARGS="-DGGML_CUDA=off -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS"
|
| 22 |
|
| 23 |
+
# تثبيت المتطلبات
|
| 24 |
RUN pip install --upgrade pip
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 26 |
RUN pip install --no-cache-dir llama-cpp-python==0.3.9
|
| 27 |
|
| 28 |
USER user
|
| 29 |
|
| 30 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|