soiz1 commited on
Commit
d0da068
·
verified ·
1 Parent(s): 14b2e19

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +55 -0
Dockerfile ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ベースイメージを指定
2
+ FROM python:3.10@sha256:ace6953906f89f6284daacd2c7addc351bf338629d89a8bb07f2a38bf38f301b
3
+
4
+ # pip と必要パッケージをインストール
5
+ RUN pip install --no-cache-dir -U pip && \
6
+ pip install --no-cache-dir \
7
+ datasets \
8
+ "huggingface-hub>=0.30" \
9
+ "protobuf<4" \
10
+ "click<8.1" \
11
+ "pydantic==2.10.6"
12
+
13
+ # 基本ユーティリティのインストール
14
+ RUN apt-get update && apt-get install -y \
15
+ git \
16
+ git-lfs \
17
+ ffmpeg \
18
+ libsm6 \
19
+ libxext6 \
20
+ cmake \
21
+ rsync \
22
+ libgl1 && \
23
+ rm -rf /var/lib/apt/lists/* && \
24
+ git lfs install
25
+
26
+ # fakeroot の設定とユーザー追加
27
+ RUN apt-get update && apt-get install -y fakeroot && \
28
+ mv /usr/bin/apt-get /usr/bin/.apt-get && \
29
+ echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get "$@"' > /usr/bin/apt-get && \
30
+ chmod +x /usr/bin/apt-get && \
31
+ rm -rf /var/lib/apt/lists/* && \
32
+ useradd -m -u 1000 user
33
+
34
+ # Node.js 20.x のインストール
35
+ RUN apt-get update && apt-get install -y curl && \
36
+ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
37
+ apt-get install -y nodejs && \
38
+ rm -rf /var/lib/apt/lists/* && \
39
+ apt-get clean
40
+
41
+ # 作業ディレクトリ設定
42
+ WORKDIR /home/user/app
43
+
44
+ # requirements.txt をコピーしてインストール
45
+ COPY requirements.txt /tmp/requirements.txt
46
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
47
+
48
+ # アプリケーションファイルをコピー
49
+ COPY . /home/user/app
50
+
51
+ # 非rootユーザーで実行
52
+ USER user
53
+
54
+ # 起動コマンド(app.pyを実行)
55
+ CMD ["python", "app.py"]