yeq6x commited on
Commit
145c501
·
1 Parent(s): a06af6c
Files changed (1) hide show
  1. Dockerfile +18 -4
Dockerfile CHANGED
@@ -1,15 +1,29 @@
1
- # ベースイメージとしてPython 3.9を使用
2
- FROM python:3.9-slim
3
 
4
  # 作業ディレクトリを設定
5
  WORKDIR /app
6
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # 必要なPythonライブラリをインストールするための依存ファイルをコピー
8
  COPY requirements.txt /app/requirements.txt
9
-
10
- # 必要なPythonパッケージをインストール
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
 
 
 
13
  # アプリケーションコードをコンテナにコピー
14
  COPY . /app
15
 
 
1
+ # ベースイメージとしてCUDA対応のPythonを使用
2
+ FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
3
 
4
  # 作業ディレクトリを設定
5
  WORKDIR /app
6
 
7
+ # 必要な依存ライブラリをインストール
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ python3-pip \
10
+ python3-dev \
11
+ build-essential \
12
+ cuda-command-line-tools-12-1 \
13
+ cuda-nvcc-12-1 \
14
+ libcudnn8=8.9.0.*-1+cuda12.1 \
15
+ libcudnn8-dev=8.9.0.*-1+cuda12.1 \
16
+ && apt-get clean \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
  # 必要なPythonライブラリをインストールするための依存ファイルをコピー
20
  COPY requirements.txt /app/requirements.txt
 
 
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # 環境変数を設定
24
+ ENV PATH="/usr/local/cuda/bin:${PATH}"
25
+ ENV XLA_FLAGS="--xla_gpu_cuda_data_dir=/usr/local/cuda"
26
+
27
  # アプリケーションコードをコンテナにコピー
28
  COPY . /app
29