StarrySkyWorld commited on
Commit
b953992
·
verified ·
1 Parent(s): aa2ed3e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -9
Dockerfile CHANGED
@@ -2,8 +2,10 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # 安装 Playwright 所需的系统依赖
6
  RUN apt-get update && apt-get install -y \
 
 
7
  libnss3 \
8
  libnspr4 \
9
  libatk1.0-0 \
@@ -19,21 +21,19 @@ RUN apt-get update && apt-get install -y \
19
  libasound2 \
20
  libpango-1.0-0 \
21
  libcairo2 \
22
- git \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
- RUN git clone https://github.com/TheSmallHanCat/flow2api.git .
 
26
 
 
 
27
 
28
-
29
- # 安装 Python 依赖
30
- COPY requirements.txt .
31
  RUN pip install --no-cache-dir -r requirements.txt
32
 
33
  # 安装 Playwright 浏览器
34
- RUN playwright install chromium
35
-
36
- COPY . .
37
 
38
  EXPOSE 8000
39
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # 安装 Playwright 所需系统依赖 + git(用于 clone)
6
  RUN apt-get update && apt-get install -y \
7
+ git \
8
+ ca-certificates \
9
  libnss3 \
10
  libnspr4 \
11
  libatk1.0-0 \
 
21
  libasound2 \
22
  libpango-1.0-0 \
23
  libcairo2 \
 
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
+ ARG REPO_URL=https://github.com/TheSmallHanCat/flow2api.git
27
+ ARG REPO_REF=main
28
 
29
+ # clone 代码到 /app
30
+ RUN git clone --depth 1 --branch "${REPO_REF}" "${REPO_URL}" .
31
 
32
+ # 安装 Python 依赖(来自仓库内 requirements.txt)
 
 
33
  RUN pip install --no-cache-dir -r requirements.txt
34
 
35
  # 安装 Playwright 浏览器
36
+ RUN python -m playwright install chromium
 
 
37
 
38
  EXPOSE 8000
39