Create Dockerfile

#1
by Selinore - opened
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # 安装 git
4
+ RUN apt-get update && apt-get install -y git && apt-get clean
5
+
6
+ # 设置工作目录
7
+ WORKDIR /app
8
+
9
+ # 设置Python环境
10
+ ENV PYTHONDONTWRITEBYTECODE=1
11
+ ENV PYTHONUNBUFFERED=1
12
+ ENV PYTHONIOENCODING=utf-8
13
+
14
+ # 克隆 GitHub 仓库
15
+ RUN git clone https://github.com/1hei1/sora-api.git .
16
+
17
+ # 安装依赖
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # 创建必要的目录
21
+ RUN mkdir -p /app/src/static/images && \
22
+ chmod -R 777 /app/src/static
23
+
24
+ RUN chmod -R 777 /app
25
+
26
+ # 暴露端口
27
+ EXPOSE 7860
28
+
29
+ # 启动应用
30
+ CMD ["python", "run.py"]