tomo2chin2 commited on
Commit
1cb214e
·
verified ·
1 Parent(s): 9e5ceac

Use official Playwright Docker image

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -15
Dockerfile CHANGED
@@ -1,29 +1,17 @@
1
- FROM python:3.10-slim
2
 
3
  # 作業ディレクトリを設定
4
  WORKDIR /app
5
 
6
- # システム依存関係をインストール
7
- COPY packages.txt .
8
- RUN apt-get update && \
9
- xargs -r -a packages.txt apt-get install -y && \
10
- apt-get clean && \
11
- rm -rf /var/lib/apt/lists/*
12
-
13
  # Python依存関係をインストール
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Playwrightブラウザをインストール
18
- RUN playwright install chromium --with-deps
19
-
20
  # アプリケーションファイルをコピー
21
  COPY . .
22
 
23
- # 非rootユーザーを作成
24
- RUN useradd -m -u 1000 user
25
- RUN chown -R user:user /app
26
- USER user
27
 
28
  # ポートを公開
29
  EXPOSE 7860
 
1
+ FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
2
 
3
  # 作業ディレクトリを設定
4
  WORKDIR /app
5
 
 
 
 
 
 
 
 
6
  # Python依存関係をインストール
7
  COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
 
 
 
10
  # アプリケーションファイルをコピー
11
  COPY . .
12
 
13
+ # 非rootユーザーを作成(playwright imageには既にplaywrightユーザーが存在)
14
+ USER pwuser
 
 
15
 
16
  # ポートを公開
17
  EXPOSE 7860