Spaces:
Runtime error
Runtime error
| # β 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}"] | |