TKgumi commited on
Commit
18026e1
·
verified ·
1 Parent(s): af23e2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -8
Dockerfile CHANGED
@@ -1,13 +1,19 @@
 
1
  FROM python:3.9
2
 
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
-
7
  WORKDIR /app
8
 
9
- COPY --chown=user ./requirements.txt requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
 
 
11
 
12
- COPY --chown=user . /app
13
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Python 3.9の公式イメージを使用
2
  FROM python:3.9
3
 
4
+ # 作業ディレクトリの設定
 
 
 
5
  WORKDIR /app
6
 
7
+ # OpenCVの依存ライブラリをインストール(libGL.so.1の問題を解決)
8
+ RUN apt-get update && apt-get install -y libgl1-mesa-glx
9
+
10
+ # 依存パッケージをインストール
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # アプリのコードをコピー
15
+ COPY . .
16
+
17
+ # FastAPIアプリを起動
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
19