# 1. 기본 이미지 설정 FROM python:3.10-slim # 2. 작업 디렉토리 설정 WORKDIR /app # 3. 시스템 라이브러리 설치 RUN apt-get update && apt-get install -y \ libsndfile1 \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # 4. OpenVoice와 MeloTTS 먼저 설치 RUN pip install git+https://github.com/myshell-ai/OpenVoice.git RUN pip install git+https://github.com/myshell-ai/MeloTTS.git # 5. requirements.txt 복사 및 나머지 설치 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 6. OpenVoice 모델 체크포인트 다운로드 # RUN mkdir -p checkpoints && \ # cd checkpoints && \ # wget https://myshell-public-repo-hosting.s3.amazonaws.com/openvoice/checkpoints_v2.zip && \ # unzip checkpoints_v2.zip && \ # rm checkpoints_v2.zip # 7. 소스 코드 복사 COPY . . # 8. 서버 실행 # Docker 빌드 시, 체크포인트 다운로드는 시간이 오래 걸리므로 # 미리 다운받아 볼륨으로 마운트하는 방식을 권장합니다. CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]