Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker file for tesseract 4.0

I am trying to create a docker file for tesseract-ocr ver 4.0. Following are the contents of the Docker file.

FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y software-properties- common && add-apt-repository -y ppa:alex-p/tesseract-ocr
RUN apt-get update && apt-get install -y tesseract-ocr

FROM python:3.6-alpine
ADD . /App
WORKDIR /App
COPY requirements.txt ./
COPY . .
RUN pip install --no-cache-dir -r requirements.txt

I am able to build the docker image, but when i spin a container and try to run a tesseract command i get "tesseract" not found.

I am not able to figure out what is wrong. Can someone please help.

like image 388
user2603610 Avatar asked Aug 18 '18 08:08

user2603610


1 Answers

FROM ubuntu:18.04
RUN apt-get update \
    && apt-get install tesseract-ocr -y \
    python3 \
    #python-setuptools \
    python3-pip \
    && apt-get clean \
    && apt-get autoremove

ADD . /home/App
WORKDIR /home/App
COPY requirements.txt ./
COPY . .

RUN pip3 install -r requirements.txt

VOLUME ["/data"]
EXPOSE 5000 5000
CMD ["python3","OCRRun.py"]
like image 163
user2603610 Avatar answered Nov 04 '22 12:11

user2603610