# Use Python base image FROM python:3.11-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Create working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install them COPY requirements.txt . RUN pip install --upgrade pip && pip install -r requirements.txt # Copy app code COPY . . # Download model at build time RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" # Expose port EXPOSE 8080 # Run app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]