init proj
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# 使用 Python 3.11 作为基础镜像
|
||||
FROM 172.16.102.3:30648/astral-sh/uv:python3.14-bookworm
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 安装系统依赖
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制项目文件
|
||||
COPY pyproject.toml uv.lock ./
|
||||
COPY main.py ./
|
||||
COPY README.md ./
|
||||
|
||||
# 使用 uv 安装依赖
|
||||
RUN uv sync --frozen
|
||||
|
||||
# 暴露 Streamlit 端口
|
||||
EXPOSE 8501
|
||||
|
||||
# 设置健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD python -c "import requests; requests.get('http://localhost:8501/_stcore/health')"
|
||||
|
||||
# 运行 Streamlit 应用
|
||||
CMD ["uv", "run", "streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
||||
|
||||
Reference in New Issue
Block a user