linjinpeng commited on
Commit
9df94e9
·
verified ·
1 Parent(s): 1f834cd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # 安装 Node.js(项目需要执行 JavaScript)
4
+ RUN apt-get update && apt-get install -y \
5
+ nodejs \
6
+ npm \
7
+ git \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 设置工作目录
11
+ WORKDIR /app
12
+
13
+ # 克隆项目
14
+ RUN git clone https://github.com/jhhgiyv/cursorweb2api.git .
15
+
16
+ # 安装 Python 依赖
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # 暴露端口
20
+ EXPOSE 7860
21
+
22
+ # 设置环境变量(Hugging Face Spaces 使用 7860 端口)
23
+ ENV PORT=7860
24
+
25
+ # 启动命令
26
+ CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]