FROM python:3.12-slim

WORKDIR /app

# 安装依赖
COPY pyproject.toml .
RUN pip install --no-cache-dir uv && \
    uv pip install --system --no-cache -r pyproject.toml

# 安装可选依赖
RUN uv pip install --system --no-cache pymupdf python-docx

# 复制代码
COPY app/ ./app/

# 创建数据目录
RUN mkdir -p /data/jarvis/data /data/jarvis/chroma /data/jarvis/uploads

EXPOSE 8000

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
