FROM python:3.12-slim

WORKDIR /app

# build deps for onnxruntime/fastembed wheels are prebuilt; keep image lean
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY app.py mcp_server.py ./

# Railway sets $PORT; default 8080 for local runs
ENV PORT=8080
CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT}"]
