Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +43 -0
Dockerfile
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ベースイメージを指定(Python 3.10 使用例)
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# 作業ディレクトリを設定
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# 必要なシステム依存関係をインストール(最小限)
|
8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
9 |
+
build-essential \
|
10 |
+
libsm6 \
|
11 |
+
libxext6 \
|
12 |
+
libgl1-mesa-glx \
|
13 |
+
git \
|
14 |
+
curl \
|
15 |
+
gnupg \
|
16 |
+
&& rm -rf /var/lib/apt/lists/*
|
17 |
+
|
18 |
+
# Git LFS の公式スクリプトを実行してインストール
|
19 |
+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \
|
20 |
+
&& apt-get install -y git-lfs
|
21 |
+
|
22 |
+
# Git LFS を初期化
|
23 |
+
RUN git lfs install
|
24 |
+
|
25 |
+
# Pythonの依存関係インストール用のキャッシュを有効活用
|
26 |
+
COPY requirements.txt .
|
27 |
+
|
28 |
+
# ディレクトリの初期化とリポジトリのクローン
|
29 |
+
RUN rm -rf /weights/* && \
|
30 |
+
git clone https://huggingface.co/datasets/soiz1/rvc-models /weights
|
31 |
+
|
32 |
+
# クローン後の確認
|
33 |
+
RUN ls -l /weights
|
34 |
+
|
35 |
+
|
36 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
37 |
+
pip install --no-cache-dir -r requirements.txt
|
38 |
+
|
39 |
+
# アプリケーションファイルをコンテナにコピー
|
40 |
+
COPY . .
|
41 |
+
|
42 |
+
# アプリのエントリポイントを設定
|
43 |
+
CMD ["python", "app.py"]
|