Skip to content

Commit

Permalink
Update image to Python3 and Ubuntu 18.04
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktorzynski committed May 9, 2022
1 parent eaf4676 commit 5db5e54
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
33 changes: 24 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@


FROM ubuntu:18.04
MAINTAINER Rick Torzynski "[email protected]"
RUN apt-get update -y
RUN apt-get install -y python-pip python-dev build-essential
RUN apt update && apt install -y libsm6 libxext6
RUN apt-get -y install tesseract-ocr

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get -y install tesseract-ocr \
&& apt-get install -y python3 python3-distutils python3-pip \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 --no-cache-dir install --upgrade pip \
&& rm -rf /var/lib/apt/lists/*


RUN apt update \
&& apt-get install ffmpeg libsm6 libxext6 -y
RUN pip3 install pytesseract
RUN pip3 install opencv-python
RUN pip3 install pillow

COPY . /app
WORKDIR /app
RUN pip install pillow
RUN pip install pytesseract
RUN pip install opencv-contrib-python


RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["app.py"]
ENTRYPOINT ["python3"]
CMD ["app.py"]
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ def upload_file():
return render_template("uploaded.html", displaytext=text, fname=filename)

if __name__ == '__main__':
app.run(host="0.0.0.0", port=5000, debug=True)
port = int(os.environ.get('PORT', 5000))
app.run(debug=True, host='0.0.0.0', port=port)
# app.run(host="0.0.0.0", port=5000, debug=True)
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ itsdangerous==1.1.0
Jinja2>=2.10.1
MarkupSafe==1.1.0
numpy==1.15.4
opencv-contrib-python==4.2.0.32
opencv-python>=4.0
pillow>=6.2.0
pytesseract==0.2.6
pytesseract>=0.2.6
werkzeug==0.15.3

0 comments on commit 5db5e54

Please sign in to comment.