-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile
36 lines (30 loc) · 1.16 KB
/
Dockerfile
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
# Base image supports Nvidia CUDA but does not require it and can also run demucs on the CPU
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
USER root
ENV TORCH_HOME=/data/models
ENV OMP_NUM_THREADS=1
# Install required tools
# Notes:
# - build-essential and python3-dev are included for platforms that may need to build some Python packages (e.g., arm64)
# - torchaudio >= 0.12 now requires ffmpeg on Linux, see https://github.com/facebookresearch/demucs/blob/main/docs/linux.md
RUN apt update && apt install -y --no-install-recommends \
build-essential \
ffmpeg \
git \
python3 \
python3-dev \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Clone Facebook Demucs
RUN git clone --depth 1 --branch v4.0.0 --single-branch https://github.com/facebookresearch/demucs /lib/demucs
WORKDIR /lib/demucs
# Install dependencies
RUN python3 -m pip install -e . --no-cache-dir
# Run once to ensure demucs works and trigger the default model download
RUN python3 -m demucs -d cpu test.mp3
# Cleanup output - we just used this to download the model
RUN rm -r separated
VOLUME /data/input
VOLUME /data/output
VOLUME /data/models
ENTRYPOINT ["/bin/bash", "--login", "-c"]