feat: 完整实现 CGO 版本 - ONNX Runtime + OpenCV DNN (YOLO)
Build and Deploy / build (push) Failing after 2m22s
Build and Deploy / deploy (push) Has been skipped

This commit is contained in:
2026-07-16 21:27:26 +00:00
parent 7afefe5e9f
commit 015b1406e2
4 changed files with 745 additions and 207 deletions
+4 -1
View File
@@ -6,6 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
libopencv-dev \
libopencv-dnn-dev \
pkg-config \
wget \
&& rm -rf /var/lib/apt/lists/*
@@ -29,7 +30,7 @@ COPY . .
RUN go mod download
# 构建
RUN go build -ldflags="-s -w" -o anticaptcha ./cmd/server
RUN PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig CGO_ENABLED=1 go build -ldflags="-s -w" -o anticaptcha ./cmd/server
# 运行阶段
FROM debian:bookworm-slim
@@ -41,6 +42,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libopencv-core406 \
libopencv-imgproc406 \
libopencv-imgcodecs406 \
libopencv-dnn406 \
libopencv-calib3d406 \
libstdc++6 \
&& rm -rf /var/lib/apt/lists/*