Download Dockerfile from judy4444/Text2Tale: direct link, hf CLI and curl.
- Browser
- Download file 968 Bytes
-
https://huggingface.co/spaces/judy4444/Text2Tale/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/judy4444/Text2Tale/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/judy4444/Text2Tale/resolve/main/Dockerfile
968 Bytes
| FROM python:3.9 | |
| # إعداد الصلاحيات لمنصة Hugging Face | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # 1. نسخ وتثبيت المكتبات | |
| COPY --chown=user requirements.txt /app/ | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # التأكد من وجود gdown لتحميل الملف | |
| RUN pip install --no-cache-dir gdown | |
| # 2. تحميل المودل وفك ضغطه وحذف الملف المضغوط لتوفير المساحة (كل هذا يحدث مرة واحدة وقت البناء) | |
| RUN gdown --id "1MZHAeCaQAyyfi6b2Dh3V_JCdTe8fTVmP" -O /app/model.zip && \ | |
| python -c "import zipfile; zipfile.ZipFile('/app/model.zip', 'r').extractall('/app/')" && \ | |
| rm /app/model.zip | |
| # 3. نسخ ملف api.py | |
| COPY --chown=user . /app/ | |
| # 4. فتح المنفذ المطلوب | |
| EXPOSE 7860 | |
| # 5. تشغيل الخادم | |
| CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"] |