Spaces:
Running
Running
File size: 608 Bytes
1bc6a5b 2fbfdce 1bc6a5b ccabb90 1bc6a5b 4505a4d 82600fc 4505a4d ccabb90 1bc6a5b ccabb90 1bc6a5b 2fbfdce 1bc6a5b b253032 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
FROM python:3.11-slim
WORKDIR /app
# Install system deps
RUN apt-get update && apt-get install -y build-essential
# Set Hugging Face cache to writable path
ENV HF_HOME=/app/.cache
# Create the cache directory explicitly
RUN mkdir -p /app/.cache
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Pre-download the embedding model
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
# Copy app code
COPY . .
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |