-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile
59 lines (51 loc) · 1.79 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM ubuntu:18.04
# Install Python and system dependencies
RUN apt-get update \
&& apt-get install tesseract-ocr -y \
python3 \
python3-pip \
&& apt-get clean \
&& apt-get autoremove
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpq-dev \
openssh-server \
vim \
apt-transport-https \
curl \
wget \
tcptraceroute \
&& apt install python3-pip \
&& pip3 install subprocess32 \
&& pip3 install gunicorn \
&& pip3 install virtualenv \
&& pip3 install flask \
&& pip3 install --upgrade setuptools \
&& pip3 install ez_setup
# https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017
# Install ODBC Driver 17 for SQL Server
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get -y install \
msodbcsql17 \
unixodbc-dev \
&& apt-get clean
# Install poppler for pdf2image module
RUN apt-get update && apt-get -y install poppler-utils && apt-get clean
# Install Tesseract OCR
RUN apt-get update && apt-get install tesseract-ocr -y
RUN mkdir -p /usr/local/share/tessdata/
RUN cp -R /usr/share/tesseract-ocr/4.00/tessdata/* /usr/local/share/tessdata/
# Install python libraries
RUN mkdir /code
COPY ./requirements.txt /code/requirements.txt
COPY ./entrypoint.py /code/entrypoint.py
WORKDIR /code
RUN pip3 install -r requirements.txt
COPY app /code
# Set ENV variables and expose ports
#ENV PATH="/root/bin:${PATH}"
EXPOSE 5000
# Configure startup
CMD ["python3", "/code/entrypoint.py"]