api-mg / Dockerfile
ibrahimlasfar's picture
update for cache
431e7f9
raw
history blame
798 Bytes
FROM python:3.10-slim
# تثبيت المتطلبات الأساسية، بما في ذلك أدوات التطوير
RUN apt-get update && apt-get install -y \
git \
wget \
gcc \
g++ \
cmake \
make \
&& rm -rf /var/lib/apt/lists/*
# إعداد مجلد العمل
WORKDIR /app
# نسخ ملفات التطبيق
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# نسخ السكريبتات والملفات
COPY app.py .
COPY setup.sh .
RUN chmod +x setup.sh
# تحميل النموذج
RUN ./setup.sh
# تعيين المتغيّر لتجنب التحذير
ENV HF_HOME=/app/.cache/huggingface
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
# تشغيل التطبيق
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]