File size: 607 Bytes
fd33333
 
696257d
fd33333
 
c716155
 
 
696257d
6f75232
 
 
696257d
fd33333
8e1c8f1
fd33333
696257d
451bf76
fd33333
696257d
fd33333
 
 
 
8e1c8f1
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
FROM python:3.10-slim

# working directory
WORKDIR /code

ENV HF_HOME=/tmp/huggingface_cache
ENV TORCH_HOME=/tmp/torch_cache

# explicitly create cache directory
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
RUN mkdir -p $TORCH_HOME && chmod -R 777 $TORCH_HOME

# dependency req by open cv
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

COPY ./requirements.txt /code/requirements.txt

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

COPY . /code/

CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]