Skip to content

Commit

Permalink
feat: add pymupdf/mutool
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPokorny committed Oct 18, 2024
1 parent f5ab5e2 commit e131e3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions executor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ARG GO_VERSION="1.23"
ARG UPM_VERSION="2.5.2"
ARG ALPINE_VERSION="3.20"
ARG RUST_VERSION="1.81"
ARG PYTHON_VERSION="3.12"
ARG UID="1001050000"

FROM docker.io/rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS build-executor-server
Expand All @@ -35,13 +36,18 @@ RUN apk add --no-cache git make gcc g++ musl-dev && \
export CGO_CFLAGS="-D_LARGEFILE64_SOURCE" && \
make install

FROM docker.io/alpine:${ALPINE_VERSION} AS build-pymupdf
RUN apk add --no-cache gcc musl-dev linux-headers make g++ clang-dev python3 python3-dev py3-pip && \
pip install --target /out pymupdf

FROM docker.io/alpine:${ALPINE_VERSION} AS runtime
RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \
bash \
coreutils \
ffmpeg \
ghostscript-fonts \
imagemagick \
mupdf-tools \
opencv \
pandoc-cli \
python3 \
Expand Down Expand Up @@ -111,6 +117,10 @@ COPY --from=build-upm /go/bin/upm /usr/local/bin/upm
COPY --from=build-upm /workdir/upm/internal/backends/python/pypi_map.sqlite /pypi_map.sqlite
ENV PYPI_MAP_DB=/pypi_map.sqlite

# pymupdf
ARG PYTHON_VERSION
COPY --from=build-pymupdf /out/. /venv/lib/python${PYTHON_VERSION}/site-packages/

# Executor server
COPY --from=build-executor-server /workdir/target/release/executor-server /usr/local/bin/executor-server

Expand Down
4 changes: 3 additions & 1 deletion executor/requirements-skip.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
ffmpeg # actually ffmpeg-python
opencv-python # installed through OS package
opencv-python # installed through OS package
pymupdf # installed manually
fitz # part of pymupdf

0 comments on commit e131e3c

Please sign in to comment.