Ryanus commited on
Commit
1665566
·
verified ·
1 Parent(s): ff55f4b

Rename run.sh to Dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +22 -0
  2. run.sh +0 -8
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用 Hugging Face 官方 Python 基础镜像
2
+ FROM python:3.11
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 复制 requirements.txt 并安装 Python 依赖
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # 安装 Playwright 浏览器和所有系统依赖
12
+ # --with-deps 参数至关重要,它会安装所有需要的系统库
13
+ RUN playwright install firefox --with-deps
14
+
15
+ # 复制应用代码到容器内
16
+ COPY . .
17
+
18
+ # Gradio 默认在 7860 端口运行
19
+ EXPOSE 7860
20
+
21
+ # 容器启动时执行的命令
22
+ CMD ["python", "app.py"]
run.sh DELETED
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Step 1: 安装 Playwright 浏览器
4
- # 我们只安装 firefox,因为代码里只用到了它,这样更快
5
- playwright install firefox
6
-
7
- # Step 2: 启动你的 Python 应用
8
- python app.py