Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 使用官方 Python 运行时作为基础镜像
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# 设置工作目录
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 安装 git(因为你需要 clone repo)
|
| 8 |
+
RUN apt-get update && apt-get install -y git && apt-get clean
|
| 9 |
+
|
| 10 |
+
# 克隆项目
|
| 11 |
+
RUN git clone https://github.com/TheSmallHanCat/sora2api.git .
|
| 12 |
+
|
| 13 |
+
# 安装依赖
|
| 14 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
+
|
| 16 |
+
# 暴露服务端口(按你的 main.py 设置修改,假设为 8000)
|
| 17 |
+
EXPOSE 8000
|
| 18 |
+
|
| 19 |
+
# 启动服务
|
| 20 |
+
CMD ["python", "main.py"]
|