Spaces:
Sleeping
Sleeping
# Base image with Python | |
FROM python:3.10-slim | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
curl \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set work directory | |
WORKDIR /app | |
# Copy application files | |
COPY . /app | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade pip | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Download SentenceTransformer model (caches on build) | |
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" | |
# Expose the app on port 7860 for Hugging Face Spaces | |
ENV PORT 7860 | |
# Start FastAPI with uvicorn | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |