mirror of
https://github.com/MaxRyabov/orio-search.git
synced 2026-10-19 15:23:33 +00:00
- Add system_prompt.md for cloud agent with skill-based workflow - Simplify skill_web_search.md to loadable skill format - Move FlashRank model download to runtime stage in Dockerfile
44 lines
1.2 KiB
Docker
44 lines
1.2 KiB
Docker
FROM python:3.12-slim AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
# System dependencies for building readability-lxml
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libxml2-dev libxslt-dev gcc \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
|
|
|
|
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Runtime dependencies only
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libxml2 libxslt1.1 ca-certificates \
|
|
&& update-ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy installed packages from builder
|
|
COPY --from=builder /install /usr/local
|
|
|
|
# Pre-download FlashRank model to avoid first-request delay
|
|
RUN python -c "from flashrank import Ranker; Ranker(model_name='ms-marco-MiniLM-L-12-v2')"
|
|
|
|
# Copy application
|
|
COPY app/ ./app/
|
|
COPY config.yaml .
|
|
|
|
EXPOSE 8000
|
|
|
|
# Production: gunicorn with uvicorn workers (uvloop + httptools auto-enabled)
|
|
CMD ["gunicorn", "app.main:app", \
|
|
"--worker-class", "uvicorn.workers.UvicornWorker", \
|
|
"--workers", "4", \
|
|
"--bind", "0.0.0.0:8000", \
|
|
"--timeout", "60", \
|
|
"--graceful-timeout", "30", \
|
|
"--keep-alive", "5", \
|
|
"--access-logfile", "-"]
|