feat: Supertonic 엔진 추가(자연스러운 한국어, MIT, ONNX)

- 전용 venv 워커(8002)로 격리, MeloTTS(8788)와 병행
- 남녀 10종 음성, 한국어/자동감지(다국어), 속도·피치
- 모델 ~260MB 베이킹, torch/GPU 불필요
- entrypoint로 워커+메인앱 동시 기동
This commit is contained in:
claude
2026-08-24 21:00:45 +09:00
parent e6bc6ef2be
commit ed09c6a08f
6 changed files with 220 additions and 10 deletions

View File

@@ -61,9 +61,22 @@ COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/pytho
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /models /models
# ===== Supertonic 엔진 (자연스러운 한국어, MIT, ONNX, torch 불필요) =====
# 전용 venv 로 의존성 격리(메인 melo 스택의 librosa 0.9.1 과 충돌 방지).
COPY supertonic_worker /opt/supertonic_worker
RUN python -m venv /opt/supertonic-venv \
&& /opt/supertonic-venv/bin/pip install --no-cache-dir -r /opt/supertonic_worker/requirements.txt
# 모델 사전 다운로드(베이킹, ~260MB) — HF_HOME=/models 캐시에 저장
RUN HF_HOME=/models /opt/supertonic-venv/bin/python -c "from supertonic import TTS; TTS(auto_download=True)"
ENV SUPERTONIC_URL=http://127.0.0.1:8002
COPY app ./app
COPY frontend ./frontend
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# 기본 MeloTTS 단일 엔진 (자동 언어 감지: 한/영 혼합)
# MeloTTS(8788, 메인) + Supertonic 워커(8002) 동시 기동
EXPOSE 8788
CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "8788"]
CMD ["/entrypoint.sh"]