luojunhui 2 days ago
parent
commit
8d628119fa
1 changed files with 16 additions and 5 deletions
  1. 16 5
      docker-compose.yml

+ 16 - 5
docker-compose.yml

@@ -1,4 +1,3 @@
-version: "3.8"
 services:
   # vLLM - Qwen3 0.6B
   vllm-0.6b:
@@ -6,14 +5,20 @@ services:
     container_name: vllm-qwen3-0.6b
     ports:
       - "8100:8000"
-    environment:
-      - HF_ENDPOINT=https://hf-mirror.com
     command: >
       --model Qwen/Qwen3-Embedding-0.6B
       --dtype float16
       --port 8000
     volumes:
-      - ./models:/root/.cache/huggingface
+      # 挂载预下载的模型目录
+      - ./models/Qwen3-Embedding-0.6B:/app/models/Qwen3-Embedding-0.6B
+      # 可选:挂载缓存目录
+      - ./cache:/root/.cache/huggingface
+    environment:
+      # 设置 Hugging Face 国内镜像
+      - HF_ENDPOINT=https://hf-mirror.com
+      # 可选:设置 Python 包索引镜像
+      - PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
     deploy:
       resources:
         reservations:
@@ -21,7 +26,13 @@ services:
             - driver: nvidia
               count: all
               capabilities: [ gpu ]
-
+    # 添加健康检查
+    healthcheck:
+      test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ]
+      interval: 30s
+      timeout: 10s
+      retries: 3
+      start_period: 40s
 #  # vLLM - Qwen3 4B
 #  vllm-4b:
 #    image: vllm/vllm-openai:latest