izuemon commited on
Commit
75d01a9
·
verified ·
1 Parent(s): bd39b6f

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +68 -0
Dockerfile ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ベースイメージ
2
+ FROM python:3.10
3
+
4
+ # 作業ディレクトリ
5
+ WORKDIR /app
6
+
7
+ # 必要パッケージのインストール
8
+ RUN apt-get update && \
9
+ apt-get install -y \
10
+ git \
11
+ git-lfs \
12
+ ffmpeg \
13
+ libsm6 \
14
+ libxext6 \
15
+ cmake \
16
+ rsync \
17
+ libgl1 \
18
+ && rm -rf /var/lib/apt/lists/* \
19
+ && git lfs install
20
+
21
+ # Node.js のインストール
22
+ RUN apt-get update && \
23
+ apt-get install -y curl && \
24
+ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
25
+ apt-get install -y nodejs && \
26
+ rm -rf /var/lib/apt/lists/* && \
27
+ apt-get clean
28
+
29
+ RUN npm install @turbowarp/packager
30
+
31
+ # pip のアップグレードと必要ライブラリのインストール
32
+ RUN pip install --no-cache-dir pip -U && \
33
+ pip install --no-cache-dir \
34
+ datasets \
35
+ "huggingface-hub>=0.30" \
36
+ "hf-transfer>=0.1.4" \
37
+ "protobuf<4" \
38
+ "click<8.1"
39
+
40
+ # Node.js のインストール
41
+ RUN apt-get update && \
42
+ apt-get install -y curl && \
43
+ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
44
+ apt-get install -y nodejs && \
45
+ rm -rf /var/lib/apt/lists/* && \
46
+ apt-get clean
47
+
48
+ # requirements.txt に基づく Python パッケージのインストール
49
+ # gradio、uvicorn、websockets、spaces も追加
50
+ RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
51
+ pip install --no-cache-dir -r /tmp/requirements.txt \
52
+ gradio[oauth,mcp]==6.5.1 \
53
+ "uvicorn>=0.14.0" \
54
+ "websockets>=10.4" \
55
+ spaces
56
+
57
+ # ユーザ用ディレクトリ作成とシンボリックリンク
58
+ RUN mkdir -p /home/user && \
59
+ ( [ -e /home/user/app ] || ln -s /app/ /home/user/app ) || true
60
+
61
+ # 現在のディレクトリをコンテナ内 /app にコピー
62
+ COPY ./ /app
63
+
64
+ # pip freeze 保存用
65
+ RUN mkdir -p /pipfreeze && pip freeze > /pipfreeze/freeze.txt
66
+
67
+ # コンテナ起動時に app.py を実行
68
+ CMD ["python", "app.py"]