File size: 996 Bytes
0f623ae
 
 
 
9c781a8
f6db3e8
0f623ae
b16f2bd
0f623ae
 
8f9b07c
bd724a8
0f623ae
 
 
 
 
ebe2347
bd724a8
0f623ae
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11-slim

WORKDIR /app

RUN apt-get update && apt-get install -y ffmpeg git libsndfile1 && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir torch==2.2.0 torchaudio==2.2.0 --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir -r requirements.txt

RUN python -c "import pathlib, site; [p.write_text(p.read_text().replace('from torchaudio.backend.common import AudioMetaData', 'try:\n    from torchaudio.backend.common import AudioMetaData\nexcept ImportError:\n    from torchaudio._backend.common import AudioMetaData')) for d in site.getsitepackages() if (p := pathlib.Path(d) / 'df/io.py').exists()]"

COPY backend/ ./backend/
COPY frontend/ ./frontend/

RUN mkdir -p backend/uploads separated

RUN python -c "from demucs.pretrained import get_model; get_model('mdx_extra')"
RUN python -c "from df.enhance import init_df; init_df()"

EXPOSE 7860

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