Merge pull request #393 from totti4ever/pr-ocrmypdf

(DOCKER) allows to use jbarlow83's official docker image of OCRmyPDF, i.e. use a newer version
This commit is contained in:
eikek 2020-10-27 18:10:34 +01:00 committed by GitHub
commit 48b800f480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View File

@ -3,4 +3,18 @@
echo "Starting unoconv listener"
unoconv -l &
# replace own ocrmypdf with official dockerfile, i.e. newer version
if [ -S "/var/run/docker.sock" ]; then
if [ ! -f "/usr/local/bin/ocrmypdf.sh" ]; then
echo "Found 'docker.sock': Installing Docker and redirecting 'ocrmypdf' command to official dockerfile by jbarlow83"
apk --no-cache add docker
mv /usr/local/bin/joex-ocrmypdf.sh /usr/local/bin/ocrmypdf
chmod ug+x /usr/local/bin/ocrmypdf
fi
docker pull -q jbarlow83/ocrmypdf:$OCRMYPDF_VERSION
echo "Using OCRmyPDF@Docker v$(ocrmypdf --version)" && echo
fi
/opt/docspell-joex/bin/docspell-joex "$@"

6
docker/joex-ocrmypdf.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
if [ ! "$1" == "--version" ]; then
echo "Using docker image for ocrmypdf (Version: $OCRMYPDF_VERSION)"
fi
docker run -v '/tmp/docspell-convert:/tmp/docspell-convert' -e "TZ=$TZ" jbarlow83/ocrmypdf:$OCRMYPDF_VERSION $@

View File

@ -9,8 +9,11 @@ FROM ${REPO}:base-binaries-${VERSION} as docspell-base-binaries
FROM ${REPO}:joex-base-${VERSION}
ENV OCRMYPDF_VERSION=v11.2.1
COPY --from=docspell-base-binaries /opt/docspell-joex /opt/docspell-joex
COPY joex-entrypoint.sh /opt/joex-entrypoint.sh
COPY joex-ocrmypdf.sh /usr/local/bin/joex-ocrmypdf.sh
ENTRYPOINT ["/opt/joex-entrypoint.sh"]
CMD ["/opt/docspell.conf"]