feat: 添加OCR识别功能及镜像优化
Some checks failed
Build Server / Compile DLL (push) Failing after 43s

- 变更基础镜像阶段为运行阶段,同时添加微信二进制包,复制项目文件并安装依赖。
- 添加处理OCR请求的端点以识别上传图像中的文本。
- 将OCR功能封装到WechatOCRClient类中并添加临时文件处理逻辑。
This commit is contained in:
2025-07-08 00:51:06 +08:00
parent 34cf6e9cbf
commit f0eda5ed50
3 changed files with 84 additions and 59 deletions

View File

@@ -5,14 +5,13 @@ RUN pacman -Syu --noconfirm cmake python nodejs && \
sed -i 's/v3.21.0/v3.21.2/g' wcocr/CMakeLists.txt && \
mkdir -p wcocr/build && cd wcocr/build && cmake .. && make -j$(nproc)
FROM greyltc/archlinux-aur:yay AS builder
FROM greyltc/archlinux-aur:yay AS runner
WORKDIR /app
RUN aur-install bun-bin
RUN aur-install bun-bin wechat-bin
COPY . .
COPY --from=lib /src/wcocr/build/libwcocr.so .
# COPY src/index.ts .
RUN bun install --frozen-lockfile
# FROM greyltc/archlinux-aur:yay AS runner
# WORKDIR /app
# RUN aur-install wechat-bin
# COPY --from=builder /app/bun-bin .
# COPY --from=lib /src/wcocr/build/libwcocr.so .
EXPOSE 3000
CMD ["bun", "src/index.ts"]