revol commited on
Commit
e2db86c
·
verified ·
1 Parent(s): 2dca56b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. 选择一个官方的 Python 基础镜像
2
+ # 我们选择 3.9 版本,它在Hugging Face上非常稳定
3
+ FROM python:3.9-slim
4
+
5
+ # 2. 设置工作目录
6
+ # 之后的所有操作都会在这个文件夹里进行
7
+ WORKDIR /code
8
+
9
+ # 3. 安装你的系统依赖 (packages.txt 的内容)
10
+ # RUN apt-get update && apt-get install -y --no-install-recommends <你的包>
11
+ # --no-install-recommends 可以减少镜像大小
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ soundstretch \
14
+ ffmpeg \
15
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
16
+
17
+ # 4. 复制你的 Python 依赖文件
18
+ COPY requirements.txt .
19
+
20
+ # 5. 安装 Python 依赖 (requirements.txt 的内容)
21
+ # --no-cache-dir 也是为了减小镜像大小
22
+ RUN pip install --no-cache-dir --upgrade pip && \
23
+ pip install --no-cache-dir -r requirements.txt
24
+
25
+ # 6. 复制你所有的应用代码到镜像里
26
+ COPY . .
27
+
28
+ # 7. 设置容器启动时要执行的命令
29
+ # 这会运行你的 app.py 文件
30
+ CMD ["python", "app.py"]