Files
wechat-ocr-server/Dockerfile
imbytecat 721bd2bb5c
All checks were successful
Build Server / Compile DLL (push) Successful in 3m56s
优化Dockerfile,添加清理缓存和临时文件步骤。
2025-07-08 01:17:25 +08:00

20 lines
613 B
Docker

FROM archlinux:base-devel AS lib
WORKDIR /src
RUN pacman -Syu --noconfirm git cmake python nodejs && \
git clone https://github.com/swigger/wechat-ocr.git wcocr && \
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 runner
WORKDIR /app
RUN aur-install bun-bin wechat-bin && \
pacman -Scc --noconfirm && \
rm -rf /var/cache/makepkg/* /tmp/* /var/log/*
COPY . .
COPY --from=lib /src/wcocr/build/libwcocr.so .
RUN bun install --frozen-lockfile
EXPOSE 3000
CMD ["bun", "src/index.ts"]