2026-04-20 17:58:03 +08:00
|
|
|
FROM python:3.13-slim-bookworm
|
|
|
|
|
|
feat: surgery pipeline API, video inference, voice confirm, and tests
- Add FastAPI routes for surgery start/end, results, pending confirmation (WAV upload), and health checks.
- Implement RTSP/Hikvision capture, consumable classification, session manager, MinIO/Baidu voice resolution, and DB persistence.
- Add documentation (client API, video backends, staging checklist) and sample camera/RTSP config.
- Add pytest suite (API contract, session manager, voice, repositories, pipeline persistence) and httpx dev dependency.
- Replace deprecated HTTP_422_UNPROCESSABLE_ENTITY with HTTP_422_UNPROCESSABLE_CONTENT.
- Fix SurgeryPipeline DB reads to use an explicit transaction with autobegin disabled.
Made-with: Cursor
2026-04-21 18:33:54 +08:00
|
|
|
# OpenCV (pulled in by ultralytics) links against X11 client libs; slim images omit them.
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
ffmpeg \
|
|
|
|
|
libgl1 \
|
|
|
|
|
libglib2.0-0 \
|
|
|
|
|
libgomp1 \
|
|
|
|
|
libxcb1 \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2026-04-20 17:58:03 +08:00
|
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
|
|
|
UV_COMPILE_BYTECODE=1 \
|
|
|
|
|
UV_LINK_MODE=copy
|
|
|
|
|
|
|
|
|
|
COPY pyproject.toml uv.lock main.py ./
|
|
|
|
|
COPY app ./app/
|
|
|
|
|
|
|
|
|
|
RUN uv sync --frozen --no-dev
|
|
|
|
|
|
|
|
|
|
ENV PATH="/app/.venv/bin:$PATH"
|
|
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|