FROM docker.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04

ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app

RUN apt update && apt install -y \
    python3 \
    python3-venv \
    python3-pip \
    git \
    libgl1 \
    libglib2.0-0 \
    ffmpeg \
    libportaudio2
RUN rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/IAHispano/Applio.git .

RUN python3 -m venv .venv

RUN .venv/bin/pip install --no-cache-dir --upgrade pip
RUN .venv/bin/pip install --no-cache-dir python-ffmpeg

RUN .venv/bin/pip install --no-cache-dir torch==2.7.1 torchvision torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128

RUN .venv/bin/pip install --no-cache-dir -r requirements.txt

EXPOSE 6969

CMD [".venv/bin/python", "app.py", "--server-name", "0.0.0.0"]
