FROM python:3.10-slim

ENV PYTHONUNBUFFERED=1

WORKDIR /opt/realtime-voice-bot

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

RUN git clone https://github.com/myshell-ai/MeloTTS.git /opt/MeloTTS
RUN pip install --no-cache-dir -e /opt/MeloTTS
RUN python -m unidic download
RUN python /opt/MeloTTS/melo/init_downloads.py

COPY melo_tts_cli.py /opt/realtime-voice-bot/melo_tts_cli.py

ENTRYPOINT ["python", "/opt/realtime-voice-bot/melo_tts_cli.py"]
