huggingapi / Dockerfile
CRYPTONEWS34's picture
Fix: Use HF_HOME=/data/huggingface to avoid permission error
1eee1c0
raw
history blame contribute delete
365 Bytes
FROM python:3.10-slim
RUN mkdir -p /tmp/huggingface
ENV HF_HOME=/tmp
# Working directory
WORKDIR /app
# Copy files
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
# Expose port 7860 (as per HF spec)
EXPOSE 7860
# Command to run FastAPI app with uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]