2022-04-24 19:57:01 +02:00
|
|
|
FROM docker.io/python:3.11.0a5-alpine3.15
|
2022-02-24 00:24:13 +01:00
|
|
|
|
2022-02-27 22:27:21 +01:00
|
|
|
# inspired by https://github.com/darktohka/pytesseract-docker/blob/master/Dockerfile
|
2022-02-24 00:24:13 +01:00
|
|
|
|
2022-02-27 22:27:21 +01:00
|
|
|
RUN apk update
|
|
|
|
RUN apk add firefox xvfb scrot vips-tools xterm xdotool fluxbox xprop imagemagick bash tesseract-ocr terminus-font ttf-inconsolata ttf-dejavu font-noto font-noto ttf-font-awesome font-noto-extra
|
|
|
|
|
|
|
|
|
|
|
|
ENV SHELL /bin/sh
|
|
|
|
ENV CC /usr/bin/clang
|
|
|
|
ENV CXX /usr/bin/clang++
|
|
|
|
ENV LANG C.UTF-8
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
|
|
|
|
ENV PIP_NO_CACHE_DIR 0
|
|
|
|
ENV TESSDATA_PREFIX /usr/local/share/tessdata
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
|
|
RUN apk add --no-cache openssl leptonica openjpeg tiff libpng zlib freetype libgcc libstdc++
|
|
|
|
# Install development tools
|
|
|
|
RUN apk add --no-cache --virtual .dev-deps file linux-headers git make automake autoconf libtool pkgconfig clang g++ openssl-dev leptonica-dev openjpeg-dev tiff-dev libpng-dev zlib-dev freetype-dev
|
|
|
|
# Install Tesseract from master
|
|
|
|
RUN mkdir /usr/local/share/tessdata
|
|
|
|
RUN mkdir tesseract
|
|
|
|
|
|
|
|
WORKDIR /tmp/tesseract
|
|
|
|
|
|
|
|
RUN wget https://github.com/tesseract-ocr/tessdata_fast/raw/main/eng.traineddata -P "$TESSDATA_PREFIX"
|
|
|
|
RUN git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git .
|
|
|
|
RUN ./autogen.sh
|
|
|
|
RUN ./configure
|
|
|
|
RUN make -j$(nproc)
|
|
|
|
RUN make install
|
|
|
|
# Install Python dependencies
|
|
|
|
RUN pip install -U --no-cache-dir pytesseract
|
|
|
|
# Cleanup
|
|
|
|
RUN apk del .dev-deps
|
|
|
|
RUN rm -f /usr/local/lib/*.a
|
|
|
|
RUN rm -rf /tmp/* /var/cache/apk/*
|
2022-05-29 22:00:28 +02:00
|
|
|
RUN apk add jq sed nodejs
|
2022-04-24 17:24:27 +02:00
|
|
|
COPY ./mozilla /root/.mozilla
|
2022-05-25 21:15:17 +02:00
|
|
|
RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
|
|
|
|
RUN apk update
|
2022-05-29 22:00:28 +02:00
|
|
|
RUN apk add wmctrl git make gcc musl-dev libx11-dev zlib zlib-dev jpeg-dev
|
2022-05-25 21:15:17 +02:00
|
|
|
RUN git clone https://github.com/muquit/grabc && cd grabc && make && make install
|
2022-05-29 22:00:28 +02:00
|
|
|
RUN apk add clang
|
2022-06-15 20:27:15 +02:00
|
|
|
RUN apk add freetype-dev
|
2022-05-29 22:00:28 +02:00
|
|
|
RUN python3 -m pip install --upgrade Pillow
|
2022-07-08 16:36:48 +02:00
|
|
|
RUN apk add zip
|
2022-07-09 20:04:57 +02:00
|
|
|
RUN apk add xclip
|
2022-07-14 22:19:34 +02:00
|
|
|
RUN apk add curl
|
2022-07-08 16:36:48 +02:00
|
|
|
|
2022-04-24 17:24:27 +02:00
|
|
|
COPY . /opt
|
2022-06-17 09:37:27 +02:00
|
|
|
CMD /opt/prepare-firefox.sh
|
2022-02-24 00:24:13 +01:00
|
|
|
|
|
|
|
WORKDIR /opt
|