xiaoh2018 commited on
Commit
280504c
·
verified ·
1 Parent(s): 2ead3f3

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +14 -26
  2. README.md +11 -0
Dockerfile CHANGED
@@ -1,35 +1,23 @@
1
- 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 \
10
- libatk-bridge2.0-0 \
11
- libcups2 \
12
- libdrm2 \
13
- libxkbcommon0 \
14
- libxcomposite1 \
15
- libxdamage1 \
16
- libxfixes3 \
17
- libxrandr2 \
18
- libgbm1 \
19
- libasound2 \
20
- libpango-1.0-0 \
21
- libcairo2 \
22
- && rm -rf /var/lib/apt/lists/*
23
 
24
- # 安装 Python 依赖
25
- COPY requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
- # 安装 Playwright 浏览器
29
- RUN playwright install chromium
30
 
31
- COPY . .
 
32
 
33
- EXPOSE 8000
 
34
 
35
- CMD ["python", "main.py"]
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
 
4
+ # Set the working directory in the container
5
  WORKDIR /app
6
 
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
+ # Install any needed packages specified in requirements.txt
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Install Playwright browsers
14
+ RUN playwright install --with-deps
15
 
16
+ # Make port 7860 available to the world outside this container
17
+ EXPOSE 7860
18
 
19
+ # Define environment variable
20
+ ENV PORT=7860
21
 
22
+ # Run app.py when the container launches
23
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  # Flow2API
2
 
3
  <div align="center">
 
1
+ ---
2
+ title: Flow2API
3
+ emoji: 🚀
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: docker
7
+ sdk_version: '1.0'
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
  # Flow2API
13
 
14
  <div align="center">