sabrina91 commited on
Commit
100acfa
·
verified ·
1 Parent(s): c23932b

Update Dockerfile.txt

Browse files
Files changed (1) hide show
  1. Dockerfile.txt +47 -6
Dockerfile.txt CHANGED
@@ -1,7 +1,48 @@
1
- FROM python:3.10-slim
2
- RUN apt-get update && apt-get install -y wget gnupg
3
- COPY requirements.txt .
4
- RUN pip install -r requirements.txt
5
- RUN playwright install chromium --with-deps
6
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
2
+
3
+ # 安裝系統依賴
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ ca-certificates \
8
+ fonts-liberation \
9
+ libappindicator3-1 \
10
+ libasound2 \
11
+ libatk-bridge2.0-0 \
12
+ libdrm2 \
13
+ libgtk-3-0 \
14
+ libnspr4 \
15
+ libnss3 \
16
+ libx11-xcb1 \
17
+ libxcomposite1 \
18
+ libxdamage1 \
19
+ libxrandr2 \
20
+ xdg-utils \
21
+ libgbm1 \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+ # 設定工作目錄
25
+ WORKDIR /app
26
+
27
+ # 複製requirements
28
+ COPY requirements.txt .
29
+
30
+ # 安裝Python套件
31
+ RUN pip install --no-cache-dir -r requirements.txt
32
+
33
+ # 安裝Playwright瀏覽器
34
+ RUN playwright install chromium --with-deps
35
+
36
+ # 複製應用程式碼
37
+ COPY . .
38
+
39
+ # 設定環境變數
40
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
41
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
42
+ ENV GRADIO_SERVER_PORT=7860
43
+
44
+ # 暴露端口
45
+ EXPOSE 7860
46
+
47
+ # 啟動應用
48
  CMD ["python", "app.py"]