File size: 805 Bytes
a3d2995
 
 
 
 
 
 
 
 
 
 
 
 
26dbe21
 
 
 
c625d5c
a3d2995
65d94a9
a3d2995
65d94a9
a3d2995
 
65d94a9
 
 
26dbe21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.13.5-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt ./
COPY src/ ./src/

# RUN ls -al ./src
# RUN pwd
RUN pip3 install -r requirements.txt
RUN pip3 install torch==2.8.0 --index-url https://download.pytorch.org/whl/cpu

EXPOSE 8501
EXPOSE 8000

# 健康检查
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

# 启动命令
# 修改点:指向 src/app.py
# 注意:--ui 后面传给 python 脚本的参数不需要加 src/ 前缀,因为那只是个参数名,但前面的运行目标必须加路径
ENTRYPOINT ["streamlit", "run", "./src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--", "--ui", "--port=8000", "--host=0.0.0.0"]