forked from abdullahibneat/TableExtraction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (21 loc) · 849 Bytes
/
Dockerfile
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
FROM python:3.7-slim-buster
RUN apt-get -y update \
&& apt-get -y upgrade \
# tesserocr requirements
&& apt-get -y install tesseract-ocr libtesseract-dev libleptonica-dev
# Required for tesserocr:
# https://github.com/sirfz/tesserocr/issues/165#issuecomment-445789709
ENV LC_ALL=C
# Use port 5000 by default, could be overwritten by cloud providers (e.g. Heroku)
ENV PORT=5000
EXPOSE ${PORT}
WORKDIR /app
COPY . .
# Build tesserocr wheel and install dependancies
RUN apt-get -y install pkg-config build-essential \
# Use piwheels for arm builds
&& pip3 install -r requirements-docker.txt --extra-index-url https://www.piwheels.org/simple \
# Remove build dependencies
&& apt-get -y purge --auto-remove pkg-config build-essential
# Get the port from $PORT environment variable
CMD gunicorn -b 0.0.0.0:$PORT app:app