# Base image # Use the Python 3.10 slim base image FROM python:3.10-slim # Set the working directory WORKDIR /app # Copy project files into the container COPY . . # Install system dependencies (including FAISS) RUN apt-get update && \ apt-get install -y libfaiss-dev && \ rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Set the cache directory for Hugging Face models ENV HF_HOME=/app/cache # Ensure the cache directory exists and is writable RUN mkdir -p /app/cache && chmod -R 777 /app/cache # Expose the application port EXPOSE 8000 # Run the application CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]