python:3.11-slim base relies on pip torch wheels bundling CUDA runtime libs, with the host NVIDIA driver passed through via the nvidia container runtime (compose GPU reservation); TORCH_HOME and XDG_CACHE_HOME point into the mounted /data volume so Demucs/wav2vec2 weights survive container recreation. Docker was not installed in the implementation sandbox, so the image was not built or run and remains untested. PyYAML was also unavailable, so docker-compose.yml was not parse-checked programmatically — only hand reviewed.
20 lines
588 B
Docker
20 lines
588 B
Docker
# torch pip wheels bundle their own CUDA runtime libs; only the host NVIDIA
|
|
# driver is needed (exposed via the nvidia container runtime), so a plain
|
|
# Python base is sufficient — no CUDA base image required.
|
|
FROM python:3.11-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY pyproject.toml ./
|
|
COPY src ./src
|
|
RUN pip install --no-cache-dir .
|
|
|
|
ENV KARAOKE_MAKER_CONFIG=/config/config.toml \
|
|
TORCH_HOME=/data/models \
|
|
XDG_CACHE_HOME=/data/models/cache
|
|
|
|
EXPOSE 8000
|
|
CMD ["karaoke-maker", "serve"]
|