Download Dockerfile from Arabic250/k: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/Arabic250/k/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Arabic250/k/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Arabic250/k/resolve/main/Dockerfile
1 kB
| FROM python:3.10-slim | |
| # ضبط بيئة العمل | |
| WORKDIR /app | |
| # تثبيت أدوات التجميع الضرورية | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| gcc \ | |
| g++ \ | |
| make \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # الخطوة الأهم: تثبيت llama-cpp-python مع تحديد عدد الوظائف لتجنب OOM | |
| # قمنا بفصلها لضمان بناء الطبقات (Layers) بشكل صحيح | |
| RUN MAX_JOBS=1 pip install --no-cache-dir llama-cpp-python | |
| # تثبيت باقي المكتبات | |
| RUN pip install --no-cache-dir \ | |
| fastapi \ | |
| uvicorn \ | |
| pydantic \ | |
| huggingface_hub | |
| # نسخ ملفات المشروع (تأكد أن هذه الخطوة بعد تثبيت المكتبات لتسريع البناء مستقبلاً) | |
| COPY . . | |
| # تشغيل التطبيق (افترضنا أن الملف الأساسي هو main.py والمنفذ 7860 الخاص بـ Spaces) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |