screenshot-service/Docker/Dockerfile

59 lines
1.9 KiB
Docker
Raw Permalink Normal View History

2022-09-12 20:12:06 +02:00
FROM docker.io/python:3.11.0rc1-alpine3.16
2022-02-24 00:24:13 +01:00
# inspired by https://github.com/darktohka/pytesseract-docker/blob/master/Dockerfile
2022-02-24 00:24:13 +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/*
RUN apk add jq sed nodejs
2022-05-25 21:15:17 +02:00
RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
RUN apk update
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
RUN apk add clang
2022-06-15 20:27:15 +02:00
RUN apk add freetype-dev
RUN python3 -m pip install --upgrade Pillow
RUN apk add zip
2022-07-09 20:04:57 +02:00
RUN apk add xclip
RUN apk add curl
RUN apk add vips
2022-09-28 20:49:35 +02:00
COPY ./mozilla /root/.mozilla
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