File size: 652 Bytes
a1b31ed
 
 
 
 
b582a51
 
a1b31ed
 
a5ab062
c6702f5
b8e37ed
3ef4ce6
 
b8e37ed
 
a5ab062
a1b31ed
 
 
 
 
 
 
c6702f5
 
 
 
 
 
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
FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    git && \
    rm -rf /var/lib/apt/lists/*

RUN mkdir -p /app/cache && chmod -R 777 /app/cache
ENV HF_HOME=/app/cache

ENV PYTHONUNBUFFERED=1
ENV EVENTLET_NO_GREENDNS=yes
ENV EVENTLET_THREADPOOL_SIZE=32
ENV EVENTLET_WEBSOCKET_MONITOR_TIMEOUT=60

COPY . /app

RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 7860

CMD ["gunicorn", \
     "--worker-class", "eventlet", \
     "--workers", "1", \
     "--timeout", "300", \
     "--bind", "0.0.0.0:7860", \
     "app:app"]