File size: 951 Bytes
9090713
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38f51bc
34dc24c
 
9090713
 
 
 
34dc24c
 
9090713
 
 
 
 
 
 
38f51bc
 
9090713
 
 
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
33
34
35
36
37
38
39
40
41
FROM python:3.11-slim

RUN apt-get update && apt-get install -y \
    pkg-config \
    libavformat-dev \
    libavcodec-dev \
    libavdevice-dev \
    libavutil-dev \
    libswscale-dev \
    libswresample-dev \
    libavfilter-dev \
    ffmpeg \
    git \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN pip install --no-cache-dir --upgrade pip setuptools wheel
RUN pip install --no-cache-dir torch torchvision torchaudio
RUN pip install --no-cache-dir torchcodec
RUN pip install --no-cache-dir av

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

RUN python -m spacy download en_core_web_sm

RUN pip install --no-cache-dir --no-deps git+https://github.com/facebookresearch/audiocraft.git

COPY . .

RUN useradd -m -u 1000 user
RUN chown -R user:user /app
USER user

ENV TORCHAUDIO_USE_BACKEND_DISPATCHER=1

EXPOSE 7860

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