2026-04-28 10:29:35 +08:00
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
# 禁止「FROM python:...」简写 — 会直连 docker.io / registry-1.docker.io。
|
|
|
|
|
|
# Python 使用 DaoCloud 增加前缀形式:https://github.com/DaoCloud/public-image-mirror
|
|
|
|
|
|
# 勿用裸 tag「3.13」;须 3.13-slim-bookworm。
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
FROM m.daocloud.io/docker.io/library/python:3.13-slim-bookworm
|
|
|
|
|
|
|
|
|
|
|
|
# Debian bookworm: use Aliyun mirror for apt (default snapshot points at deb.debian.org).
|
|
|
|
|
|
RUN sed -i \
|
|
|
|
|
|
-e 's|http://deb.debian.org/debian-security|https://mirrors.aliyun.com/debian-security|g' \
|
|
|
|
|
|
-e 's|http://deb.debian.org/debian|https://mirrors.aliyun.com/debian|g' \
|
|
|
|
|
|
/etc/apt/sources.list.d/debian.sources
|
2026-04-20 17:58:03 +08:00
|
|
|
|
|
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 \
|
2026-04-23 14:24:20 +08:00
|
|
|
|
docker.io \
|
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
|
|
|
|
ffmpeg \
|
|
|
|
|
|
libgl1 \
|
|
|
|
|
|
libglib2.0-0 \
|
|
|
|
|
|
libgomp1 \
|
|
|
|
|
|
libxcb1 \
|
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
2026-04-28 10:29:35 +08:00
|
|
|
|
# ghcr.io:「增加前缀」形式(与 kindest/node 示例一致)
|
|
|
|
|
|
COPY --from=m.daocloud.io/ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
2026-04-20 17:58:03 +08:00
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
|
|
|
|
UV_COMPILE_BYTECODE=1 \
|
|
|
|
|
|
UV_LINK_MODE=copy
|
|
|
|
|
|
|
|
|
|
|
|
COPY pyproject.toml uv.lock main.py ./
|
|
|
|
|
|
COPY app ./app/
|
|
|
|
|
|
|
2026-04-28 10:29:35 +08:00
|
|
|
|
# uv.lock pins full download URLs. Rewrite to mainland-accessible mirrors (same paths / hashes).
|
|
|
|
|
|
# PyPI: Tsinghua | PyTorch wheel index: 南大 (syncs download.pytorch.org / download-r2)
|
|
|
|
|
|
RUN sed -i \
|
|
|
|
|
|
-e 's|https://files.pythonhosted.org|https://pypi.tuna.tsinghua.edu.cn|g' \
|
|
|
|
|
|
-e 's|https://pypi.org/simple|https://pypi.tuna.tsinghua.edu.cn/simple|g' \
|
|
|
|
|
|
-e 's|https://download-r2.pytorch.org|https://mirrors.nju.edu.cn/pytorch|g' \
|
|
|
|
|
|
-e 's|https://download.pytorch.org|https://mirrors.nju.edu.cn/pytorch|g' \
|
|
|
|
|
|
uv.lock
|
|
|
|
|
|
|
|
|
|
|
|
ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
|
|
|
2026-04-20 17:58:03 +08:00
|
|
|
|
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"]
|