File size: 570 Bytes
87a77d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.9

WORKDIR /content

RUN mkdir /content/cache/

RUN export TRANSFORMERS_CACHE=/content/cache/

COPY ./requirements.txt /content/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /content/requirements.txt
RUN apt-get update
RUN apt-get install -y ffmpeg

COPY . .

RUN adduser --disabled-password --gecos '' admin
RUN adduser admin sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

RUN chown -R admin:admin /content
RUN chmod -R 777 /content
USER admin

EXPOSE 7860

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