Spaces:
Sleeping
Sleeping
# Use lightweight Python | |
FROM python:3.10-slim | |
# Set working directory | |
WORKDIR /app | |
# Set env for Hugging Face cache | |
ENV HF_HOME=/tmp/huggingface | |
ENV TRANSFORMERS_CACHE=/tmp/hf_cache | |
ENV HF_HUB_CACHE=/tmp/hf_cache | |
# Copy requirements first for caching | |
COPY requirements.txt . | |
# Install dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy project files | |
COPY . . | |
# Expose FastAPI port | |
EXPOSE 7860 | |
# Run FastAPI with uvicorn | |
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |