File size: 883 Bytes
39371b7
 
 
 
 
 
 
 
 
 
 
 
ee97459
 
 
 
 
 
 
 
 
 
39371b7
 
 
a637b3a
 
 
39371b7
 
 
 
 
 
 
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
FROM python:3.8.10-slim

WORKDIR /app

# install linux package dependencies
RUN apt-get update -y && \
    apt-get -y install gcc g++ && \
    rm -rf /var/lib/apt/lists/*

# can copy files only from current working directory where docker builds
# cannot copy files from arbitrary directories

# User
RUN useradd -m -u 1000 user
USER user
ENV HOME /home/user
ENV PATH $HOME/.local/bin:$PATH

WORKDIR $HOME
RUN mkdir app
WORKDIR $HOME/app

COPY ./artifacts/ /data/models/
COPY ./requirements.txt .

RUN pip install --no-cache-dir torch==1.11.0+cpu torchvision==0.12.0+cpu torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir pybind11==2.12.0
RUN pip install --no-cache-dir -r requirements.txt

COPY ./iam_line_recognition/*.py ./iam_line_recognition/
COPY ./*.py .

EXPOSE 7860

CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]