# Use Python 3.11 slim FROM python:3.11-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ libpq-dev \ curl \ && rm -rf /var/lib/apt/lists/* # Copy requirements first (for Docker layer caching) COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Download spaCy model RUN python -m spacy download en_core_web_sm # Copy entire project COPY . . # Expose FastAPI port EXPOSE 8000 # Start the server CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]