Dockerfile 803 Bytes
Newer Older
wangkaixiong's avatar
init  
wangkaixiong committed
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 使用官方 Python 镜像作为基础
FROM python:3.9-slim

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    build-essential \
    libssl-dev \
    libffi-dev \
    python3-dev \
    curl \
    && rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /app

# 复制监控脚本和相关文件
COPY /public/wkx/dcgm/mon /app

# 安装 Python 依赖
RUN pip install --no-cache-dir \
    gradio \
    requests \
    pyyaml \
    pandas \
    plotly \
    gunicorn

# 创建数据目录
RUN mkdir -p /app/data

# 创建启动脚本
COPY entrypoint.sh /app/
RUN chmod +x /app/entrypoint.sh

# 暴露端口
EXPOSE 7860

# 设置环境变量
ENV PYTHONUNBUFFERED=1
ENV DB_PATH=/app/data/monitor.db
ENV YAML_PATH=/app/dev_list.yaml

# 设置入口点
ENTRYPOINT ["/app/entrypoint.sh"]