Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +25 -4
Dockerfile
CHANGED
@@ -1,12 +1,30 @@
|
|
1 |
-
# 使用官方 Python 3 镜像作为基础镜像
|
2 |
-
FROM python:3.12
|
3 |
|
4 |
# 设置环境变量以确保 Python 输出被正确刷新
|
5 |
ENV PYTHONUNBUFFERED=1
|
6 |
|
7 |
-
# 安装 git
|
8 |
RUN apt-get update && \
|
9 |
-
apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
# 设置工作目录
|
@@ -21,6 +39,9 @@ RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp
|
|
21 |
# 安装 Python 依赖
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
|
|
|
|
|
|
|
24 |
# 暴露应用所使用的端口
|
25 |
EXPOSE 7788
|
26 |
|
|
|
1 |
+
# 使用官方 Python 3.12-slim 镜像作为基础镜像
|
2 |
+
FROM python:3.12-slim
|
3 |
|
4 |
# 设置环境变量以确保 Python 输出被正确刷新
|
5 |
ENV PYTHONUNBUFFERED=1
|
6 |
|
7 |
+
# 安装 git 和 Playwright 运行所需的系统依赖
|
8 |
RUN apt-get update && \
|
9 |
+
apt-get install -y --no-install-recommends \
|
10 |
+
git \
|
11 |
+
wget \
|
12 |
+
libnss3 \
|
13 |
+
libatk1.0-0 \
|
14 |
+
libatk-bridge2.0-0 \
|
15 |
+
libcups2 \
|
16 |
+
libdrm2 \
|
17 |
+
libxrandr2 \
|
18 |
+
libxfixes3 \
|
19 |
+
libxcomposite1 \
|
20 |
+
libasound2 \
|
21 |
+
libxdamage1 \
|
22 |
+
libxrender1 \
|
23 |
+
fonts-liberation \
|
24 |
+
libgbm1 \
|
25 |
+
ca-certificates \
|
26 |
+
curl \
|
27 |
+
gnupg && \
|
28 |
rm -rf /var/lib/apt/lists/*
|
29 |
|
30 |
# 设置工作目录
|
|
|
39 |
# 安装 Python 依赖
|
40 |
RUN pip install --no-cache-dir -r requirements.txt
|
41 |
|
42 |
+
# 安装 Playwright 并下载所需的浏览器
|
43 |
+
RUN pip install --no-cache-dir playwright && playwright install --with-deps
|
44 |
+
|
45 |
# 暴露应用所使用的端口
|
46 |
EXPOSE 7788
|
47 |
|