Switch to bridge networking with fixed container port 80 and served name llm

- run.sh: bridge + -p ${HOST_PORT:-24396}:80, health check uses host port
- entrypoint.sh: PORT defaults to 80, SERVED_NAME defaults to llm
  detected port/served name become log hints only
- verify.sh: read host port from port bindings, expect model name llm
- docker-compose.yml: ports mapping instead of network_mode host
- README: update tables, commands and rationale
This commit is contained in:
2026-10-28 14:19:42 +08:00
parent d2624682ca
commit ade41407d7
5 changed files with 99 additions and 56 deletions

View File

@@ -9,12 +9,14 @@ services:
# 镜像本身不设置启动命令,启动方式全部由这里决定。
entrypoint: ["/usr/local/bin/gemma4-entrypoint.sh"]
working_dir: /opt/gemma4
expose:
- "8094"
- "8095"
# vLLM 多卡 NCCL / 端口直通
network_mode: host
# 容器内固定监听 80,宿主机端口由 HOST_PORT 决定(默认 24396)。
expose:
- "80"
ports:
- "${HOST_PORT:-24396}:80"
# bridge 网络 + 端口映射;ipc host 供 vLLM/PyTorch 多卡共享内存。
ipc: host
# Iluvatar 运行时需要 privileged + /dev 绑定。
@@ -36,11 +38,13 @@ services:
# entrypoint 按检测出的 TP 使用前 TP 张。
CUDA_VISIBLE_DEVICES: "${GPUS:-15,14,13,12}"
# 容器内端口固定 80,模型名固定 llm(AGENTS.md 5.2 / 5.5)。
PORT: "80"
SERVED_NAME: "${SERVED_NAME:-llm}"
# 留空时由 entrypoint 根据 config.json 自动判断。
# 需要手动覆盖时直接设置同名环境变量即可。
TP: "${TP:-}"
PORT: "${PORT:-}"
SERVED_NAME: "${SERVED_NAME:-}"
MAX_NUM_SEQS: "${MAX_NUM_SEQS:-}"
GPU_MEM_UTIL: "${GPU_MEM_UTIL:-}"
ENFORCE_EAGER: "${ENFORCE_EAGER:-}"