Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile docd container with OCR #118

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM docker.io/golang:1.14-buster AS build
RUN apt update && \
apt install -y software-properties-common && \
apt-get --assume-yes install apt-transport-https && \
apt-add-repository 'deb https://notesalexp.org/tesseract-ocr-dev/buster/ buster main' && \
apt-get update -oAcquire::AllowInsecureRepositories=true && \
apt-get --assume-yes --allow-unauthenticated install notesalexp-keyring -oAcquire::AllowInsecureRepositories=true && \
apt-get update && \
apt-get --assume-yes install tesseract-ocr libtesseract-dev tesseract-ocr-tha
WORKDIR /go/src/code.sajari.com/docconv/
COPY ./ ./
WORKDIR /go/src/code.sajari.com/docconv/docd/
RUN go get -t github.com/otiai10/gosseract/...
RUN go build -tags ocr .
FROM docker.io/debian:11-slim AS docd
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
lynx \
poppler-utils \
tidy \
unrtf \
wv \
zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt update && \
apt install -y software-properties-common && \
apt-get --assume-yes install apt-transport-https && \
apt-add-repository 'deb https://notesalexp.org/tesseract-ocr-dev/bullseye/ bullseye main' && \
apt-get update -oAcquire::AllowInsecureRepositories=true && \
apt-get --assume-yes --allow-unauthenticated install notesalexp-keyring -oAcquire::AllowInsecureRepositories=true && \
apt-get update && \
apt-get --assume-yes install tesseract-ocr libtesseract-dev tesseract-ocr-tha
EXPOSE 8888
COPY --from=build /go/src/code.sajari.com/docconv/docd/docd /docd
ENTRYPOINT ["/docd"]
CMD ["--help"]