| 12345678910111213141516171819 |
- # 主节点(151)后端 — 轻量级 Python 镜像,不含 GPU 依赖
- # 仅负责 API/DB/WebSocket/SSH 调度,实际训练/推理在 253 算力节点执行
- FROM docker.mirrors.ustc.edu.cn/library/python:3.10-slim
- WORKDIR /app
- RUN apt-get update && apt-get install -y git openssh-client sshpass && rm -rf /var/lib/apt/lists/*
- COPY requirements.txt .
- RUN pip install --no-cache-dir -r requirements.txt
- COPY . .
- EXPOSE 8010
- HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
- CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8010/health')" || exit 1
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8010"]
|