File size: 757 Bytes
b84e215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Stage 1: Build stage (installs docker)
FROM python:3.9.13 AS builder

RUN apt-get update && apt-get install -y docker-ce

# Clear build cache
RUN docker builder prune -f

FROM python:3.9.13

USER root
RUN apt-get update && \
    apt-get install -y libgl1-mesa-glx ffmpeg

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

WORKDIR $HOME/app

COPY --chown=user . $HOME/app

RUN chmod +x scripts/download_models.sh
RUN bash scripts/download_models.sh
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
RUN pip install -r requirements.txt

# CMD ["gunicorn", "-b", "0.0.0.0:7860","app:app"]
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "180", "app:app"]

#CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]