gemma / Dockerfile
luck210's picture
Update Dockerfile
a9dd3d9 verified
raw
history blame
557 Bytes
FROM python:3.9-slim
# Installer les dépendances
RUN pip install fastapi uvicorn pydantic requests transformers torch python-multipart
# Créer un répertoire de cache accessible
RUN mkdir -p /app/cache && chmod 777 /app/cache
# Copier le code
COPY app.py /app/app.py
# Définir le dossier de travail
WORKDIR /app
# Définir le cache pour transformers
ENV TRANSFORMERS_CACHE=/app/cache
ENV HF_HOME=/app/cache
# Exposer le port pour Hugging Face Spaces
EXPOSE 7860
# Démarrer FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]