FROM python:3.12-slim-bookworm

ARG YUE2_COMMIT=9c6c4b349be978b06a9d0d958471a07a6cdeff4d

RUN apt-get update \
    && apt-get install -y --no-install-recommends ca-certificates git libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/multimodal-art-projection/YuE.git /opt/yue2 \
    && git -C /opt/yue2 checkout "${YUE2_COMMIT}" \
    && python -m pip install --no-cache-dir /opt/yue2

WORKDIR /workspace
ENV PYTHONUNBUFFERED=1 \
    YUE2_KIT=/workspace

ENTRYPOINT ["yue2"]
