Spaces:
Sleeping
Sleeping
File size: 645 Bytes
5b40291 | 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 27 28 | # Use an official lightweight Python image
FROM python:3.10-slim
# Set environment variables to prevent Python from writing .pyc files and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /app/hf_cache
# Set working directory
WORKDIR /app
# Copy and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire application
COPY . .
RUN chmod 777 /app/faqs.csv
# Expose the port FastAPI will run on (Hugging Face requires 7860)
EXPOSE 7860
# Run the FastAPI app using uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|