File size: 657 Bytes
9f7cb6f b6f0bc8 9f7cb6f | 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 | FROM python:3.13-slim
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Pre-download the fine-tuned sentence-transformers model so first request is fast
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('Clarkoer/gal-mpnet-finetuned')"
# Copy the entire project
COPY . .
# Expose port (7860 = HF Spaces default, also works on Render/Railway via PORT env)
EXPOSE 7860
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
# Run the server from the Backend directory
WORKDIR /app/Backend
CMD ["python", "server.py"]
|