# Use the official lightweight Python image as a base FROM python:3.10-slim # Set the working directory inside the container WORKDIR /app # Copy the requirements file first for better caching COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the source code into the container COPY src/ /app/src/ # Expose the port the app will run on (port 7860 is expected for Hugging Face Spaces) EXPOSE 7860 # Set environment variables ENV PYTHONUNBUFFERED=1 # Start the app when the container launches CMD ["python", "src/search_engine/app.py"]