File size: 978 Bytes
80cb407
 
 
84b237c
80cb407
feae468
2fc0c7d
 
 
feae468
bc3627b
 
 
 
db65dc2
272c998
 
80cb407
 
 
 
 
 
 
 
 
 
40d728a
498fece
 
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
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

FROM python:3.9

# Set proper Python threading configuration
# ENV OMP_NUM_THREADS=4
# ENV NUMEXPR_NUM_THREADS=4
# ENV MKL_NUM_THREADS=4

# Set timezone
ENV TZ=Asia/Jakarta
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt update
RUN apt --yes install ffmpeg

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

WORKDIR /app

COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

COPY --chown=user . /app
# CMD ["gunicorn", "--timeout", "300", "-b", "0.0.0.0:7860", "app:app"]
# CMD ["gunicorn", "--timeout", "300", "--workers", "1", "--threads", "4", "-b", "0.0.0.0:7860", "app:app"]
CMD ["gunicorn", "--timeout", "300", "--workers", "2", "--threads", "4", "--worker-class", "gthread", "-b", "0.0.0.0:7860", "app:app"]