Files
rocm-chatterbox-whisper/Dockerfile.rocm
scott 60279389f2
All checks were successful
Build ROCm Image / build (push) Successful in 3m11s
Create miopen_cache dir in Dockerfile before volume mount
MIOpen crashes with SQLite 'unable to open database file' when the
directory doesn't exist at container start. mkdir + chmod 777 ensures
the path is present and writable before the named volume overlays it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 13:52:03 -04:00

52 lines
1.6 KiB
Docker

FROM rocm/dev-ubuntu-22.04:7.2
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
HF_HOME=/app/hf_cache \
PIP_NO_CACHE_DIR=1
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
git \
ffmpeg \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Step 1: Install ROCm-compatible PyTorch stack first.
# This must happen before anything else to prevent pip from pulling CPU wheels.
COPY requirements-rocm-init.txt .
RUN pip3 install -r requirements-rocm-init.txt
# Step 2: Install remaining dependencies (pinned to avoid overwriting torch).
COPY requirements-rocm.txt .
RUN pip3 install -r requirements-rocm.txt
# Step 3: Install chatterbox with --no-deps so pip cannot replace ROCm torch.
RUN pip3 install --no-deps chatterbox-tts
# Stub out resemble-perth (audio watermarking, unnecessary for self-hosted use).
# Placed after pip layers so changes to the stub don't bust the cache above.
COPY perth_stub.py .
RUN python3 -c "import site; print(site.getsitepackages()[0])" | \
xargs -I{} cp /app/perth_stub.py {}/perth.py
# Application source
COPY engine.py config.py wyoming_handler.py wyoming_voices.py main.py ./
# Default config (can be overridden by volume mount)
COPY config.yaml .
# Create default directories (miopen_cache must exist before the volume mounts
# so MIOpen can open its SQLite benchmark database without crashing)
RUN mkdir -p voices reference_audio hf_cache miopen_cache && \
chmod 777 miopen_cache
EXPOSE 10200
CMD ["python3", "main.py"]