cacode commited on
Commit
d178b4b
·
verified ·
1 Parent(s): 135a8de

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.10-slim
3
+
4
+ # 安装 wkhtmltopdf 及必要依赖
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
7
+ wkhtmltopdf \
8
+ libfontconfig \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # 设置工作目录
12
+ WORKDIR /app
13
+
14
+ # 复制 requirements 并安装
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # 复制应用代码
19
+ COPY app/ ./app/
20
+
21
+ # 端口
22
+ EXPOSE 7860
23
+
24
+ # 启动
25
+ CMD ["python", "app/main.py"]