Spaces:
Sleeping
Sleeping
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 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 pybind11==2.12.0 | |
RUN pip install -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"] | |