File size: 591 Bytes
79cdd38
 
 
 
 
 
 
 
 
74479a8
 
 
 
79cdd38
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    git curl build-essential \
    && rm -rf /var/lib/apt/lists/*

# Use slim API-only requirements (no torch/GPU/fine-tuning packages)
# This keeps the image ~2GB instead of ~8GB
COPY requirements-api.txt .
RUN pip install --no-cache-dir --timeout=120 -r requirements-api.txt

# Copy project code
COPY . .

# Expose API port (HuggingFace Spaces uses 7860)
EXPOSE 7860

# Start FastAPI
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]