-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 1.31 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (33 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use Ubuntu as the base image
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Update and install dependencies
RUN apt update && apt install -y \
git autoconf automake libtool pkg-config \
libpng-dev libjpeg8-dev libtiff5-dev zlib1g-dev \
libwebp-dev libopenjp2-7-dev libgif-dev \
libarchive-dev libcurl4-openssl-dev libicu-dev \
libpango1.0-dev libcairo2-dev libleptonica-dev \
wget python3-pip vim && \
apt clean
# Clone and build Tesseract
RUN git clone https://github.com/tesseract-ocr/tesseract.git && \
cd tesseract && \
./autogen.sh && \
./configure && \
make && make install && ldconfig && \
make training && make training-install
# Clone tesstrain
RUN git clone https://github.com/tesseract-ocr/tesstrain.git /tesseract/tesstrain
# Set the working directory
WORKDIR /tesseract/tesstrain
# Install Python requirements
RUN pip3 install -r requirements.txt
# Fetch language data
RUN make tesseract-langdata
# Download the required traineddata files from the tessdata_best repository
RUN wget -P /usr/local/share/tessdata/ https://github.com/tesseract-ocr/tessdata_best/raw/main/ben.traineddata
RUN wget -P /usr/local/share/tessdata/ https://github.com/tesseract-ocr/tessdata_best/raw/main/eng.traineddata
# Set entry point (optional)
CMD ["bash"]