forked from mindee/doctr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-api
34 lines (27 loc) · 901 Bytes
/
Dockerfile-api
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
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
WORKDIR /app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH "${PYTHONPATH}:/app"
# copy requirements file
COPY api/requirements.txt /app/api-requirements.txt
COPY ./requirements.txt /tmp/requirements.txt
RUN apt-get update \
&& apt-get install --no-install-recommends ffmpeg libsm6 libxext6 -y \
&& pip install --upgrade pip setuptools wheel \
&& pip install -r /app/api-requirements.txt \
&& pip install -r /tmp/requirements.txt \
&& pip cache purge \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache/pip
# install doctr
COPY ./README.md /tmp/README.md
COPY ./setup.py /tmp/setup.py
COPY ./doctr /tmp/doctr
RUN pip install -e /tmp/.[tf] \
&& pip cache purge \
&& rm -rf /root/.cache/pip
# copy project
COPY api /app