ElvisWang111 commited on
Commit
01c66db
·
verified ·
1 Parent(s): 887ccfe

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -11
Dockerfile CHANGED
@@ -1,22 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # ========= 基础镜像 =========
2
  FROM python:3.12-slim
3
 
4
- # ========= 设置工作目录 =========
5
- WORKDIR /app
6
 
7
  # ========= 安装依赖 =========
8
  COPY ./requirements.txt ./requirements.txt
9
- RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
10
- && pip install --no-cache-dir -r requirements.txt
11
 
12
  # ========= 拷贝项目文件 =========
13
- COPY . /app
14
 
15
- # ========= 暴露 Streamlit 端口 =========
16
  EXPOSE 8501
17
-
18
- # ========= 健康检查 =========
19
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
20
-
21
- # ========= 启动命令 =========
22
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ # # ========= 基础镜像 =========
2
+ # FROM python:3.12-slim
3
+
4
+ # # ========= 设置工作目录 =========
5
+ # WORKDIR /app
6
+
7
+ # # ========= 安装依赖 =========
8
+ # COPY ./requirements.txt ./requirements.txt
9
+ # RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
10
+ # && pip install --no-cache-dir -r requirements.txt
11
+
12
+ # # ========= 拷贝项目文件 =========
13
+ # COPY . /app
14
+
15
+ # # ========= 暴露 Streamlit 端口 =========
16
+ # EXPOSE 8501
17
+
18
+ # # ========= 健康检查 =========
19
+ # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
20
+
21
+ # # ========= 启动命令 =========
22
+ # CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
23
  # ========= 基础镜像 =========
24
  FROM python:3.12-slim
25
 
26
+ # ========= 改变工作目录 =========
27
+ WORKDIR /tmp # ✅ 关键:所有相对路径都自动指向 /tmp,可写!
28
 
29
  # ========= 安装依赖 =========
30
  COPY ./requirements.txt ./requirements.txt
31
+ RUN pip install --no-cache-dir -r requirements.txt
 
32
 
33
  # ========= 拷贝项目文件 =========
34
+ COPY . /tmp # 放到 /tmp 中(而不是 /app
35
 
36
+ # ========= 暴露端口并启动 =========
37
  EXPOSE 8501
 
 
 
 
 
38
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]