Spaces:
Runtime error
Runtime error
File size: 823 Bytes
a84baaf e4d3035 e88861e 59c38e1 e88861e e4d3035 56b3376 a84baaf 59c38e1 a84baaf 59c38e1 a84baaf 56b3376 a84baaf d3ec3d3 56b3376 a84baaf 59c38e1 d2fd474 a84baaf d42f1d2 a84baaf d42f1d2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# 📦 Image de base
FROM python:3.10
# ✅ Installer les outils nécessaires pour llama-cpp
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
&& rm -rf /var/lib/apt/lists/*
# ✅ Rediriger le cache HF vers un dossier autorisé dans le conteneur
ENV HF_HOME=/app/cache
ENV TRANSFORMERS_CACHE=/app/cache
ENV HF_MODULES_CACHE=/app/cache
ENV HF_HUB_CACHE=/app/cache
# ✅ Créer le dossier de cache avec accès total
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# 📁 Dossier de travail
WORKDIR /app
# 🧪 Installer les dépendances
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 🧠 Copier tout le code
COPY . .
# 🌐 Exposer le port HTTP
EXPOSE 7860
# 🚀 Lancer FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|