Files
wechat-ocr-server/Dockerfile
imbytecat b96edf83a5
Some checks failed
Build Server / Compile DLL (push) Failing after 2m39s
refactor: 优化容器缓存清理逻辑
- 优化容器缓存清理逻辑,增加对Pacman和Yay缓存的清除。
2025-07-18 23:02:31 +08:00

19 lines
597 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 && \
mkdir -p wcocr/build && cd wcocr/build && cmake .. && make -j$(nproc)
FROM greyltc/archlinux-aur:yay AS runner
WORKDIR /app
COPY . .
COPY --from=lib /src/wcocr/build/libwcocr.so .
RUN aur-install bun-bin wechat-bin && \
pacman -Scc --noconfirm && rm -rf /var/cache/pacman/pkg/* && \
yay -Scc --noconfirm && rm -rf $HOME/.cache/yay/* && \
bun install --frozen-lockfile
EXPOSE 3000
CMD ["bun", "src/index.ts"]