Files

24 lines
904 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# iAOP 推理服务镜像(部署用,对齐 deploy/k8s/helm/iaop Chart 契约)
# 构建:docker build -t iaop/inference:v1.0.0 -f deploy/k8s/docker/Dockerfile .
FROM python:3.11-slim
WORKDIR /app
# 推理后端内核代码(core/inference-backend,纯标准库,无硬件强依赖)。
# 目录名含连字符,镜像内复制为下划线名以便 import inference_backend。
COPY core/inference-backend/ /app/inference_backend/
# HTTP 服务入口(/health + /v1/chat/completions + /v1/models)
COPY deploy/k8s/docker/serve.py /app/serve.py
# 仅需 PyYAML 解析 backends.yaml(Chart backend-configmap 挂载)
RUN pip install --no-cache-dir pyyaml -i https://pypi.tuna.tsinghua.edu.cn/simple
ENV IAOP_BACKEND_CONFIG=/etc/iaop/backends.yaml \
IAOP_PORT=8000
EXPOSE 8000
# 探针契约:GET /health → 200;推理:POST /v1/chat/completions
CMD ["python", "/app/serve.py"]