igenrate / Dockerfile
sujal7102003's picture
Upload folder using huggingface_hub
5df79c9 verified
raw
history blame contribute delete
772 Bytes
# βœ… Use official Python base image
FROM python:3.10
# βœ… Set working directory
WORKDIR /app
# βœ… Create Hugging Face cache dir with correct permissions
RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface
# βœ… Environment variables for Transformers & PEFT caching
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/huggingface
ENV HUGGINGFACE_HUB_CACHE=/tmp/huggingface
# βœ… Copy all app files into container
COPY . .
# βœ… Install dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# βœ… Expose app port (default 7860 for HF Spaces)
EXPOSE 7860
# βœ… Run FastAPI app (no changes here as per your instruction)
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-7860}"]