docker-compose.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. services:
  2. # vLLM - Qwen3 0.6B
  3. vllm-0.6b:
  4. image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/vllm/vllm-openai:latest
  5. container_name: vllm-qwen3-0.6b
  6. ports:
  7. - "8100:8000"
  8. command: >
  9. sh -c "
  10. pip install --upgrade vllm &&
  11. pip install --upgrade transformers &&
  12. python -m vllm.entrypoints.openai.api_server --model /app/models/Qwen3-Embedding-0.6B --dtype float16 --port 8000
  13. "
  14. volumes:
  15. # 挂载预下载的模型目录
  16. - ./models/Qwen3-Embedding-0.6B:/app/models/Qwen3-Embedding-0.6B
  17. # 可选:挂载缓存目录
  18. - ./cache:/root/.cache/huggingface
  19. environment:
  20. # 设置 Hugging Face 国内镜像
  21. - HF_ENDPOINT=https://hf-mirror.com
  22. # 可选:设置 Python 包索引镜像
  23. - PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
  24. deploy:
  25. resources:
  26. reservations:
  27. devices:
  28. - driver: nvidia
  29. count: all
  30. capabilities: [ gpu ]
  31. # 添加健康检查
  32. healthcheck:
  33. test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ]
  34. interval: 30s
  35. timeout: 10s
  36. retries: 3
  37. start_period: 40s
  38. # # vLLM - Qwen3 4B
  39. # vllm-4b:
  40. # image: vllm/vllm-openai:latest
  41. # container_name: vllm-qwen3-4b
  42. # ports:
  43. # - "8200:8000"
  44. # command: >
  45. # --model Qwen/Qwen3-Embedding-4B
  46. # --dtype float16
  47. # --api-port 8000
  48. # volumes:
  49. # - ./models:/root/.cache/huggingface
  50. #
  51. # # vLLM - Qwen3 8B
  52. # vllm-8b:
  53. # image: vllm/vllm-openai:latest
  54. # container_name: vllm-qwen3-8b
  55. # ports:
  56. # - "8300:8000"
  57. # command: >
  58. # --model Qwen/Qwen3-Embedding-8B
  59. # --dtype float16
  60. # --api-port 8000
  61. # volumes:
  62. # - ./models:/root/.cache/huggingface
  63. # Milvus 向量数据库
  64. # milvus:
  65. # image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/milvusdb/milvus:v2.4.5
  66. ## image: milvusdb/milvus:v2.4.4-standalone
  67. # container_name: milvus
  68. # ports:
  69. # - "19530:19530"
  70. # - "9091:9091"
  71. # environment:
  72. # - ETCD_USE_EMBED=true
  73. # - MINIO_USE_EMBED=true
  74. # - PULSAR_USE_EMBED=true
  75. # volumes:
  76. # - ./milvus_data:/var/lib/milvus
  77. # command: ["milvus", "run", "standalone"]