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