docker-compose.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. version: "3.8"
  2. services:
  3. backend:
  4. build:
  5. context: ./backend
  6. dockerfile: Dockerfile
  7. container_name: finetune-backend
  8. restart: unless-stopped
  9. ports:
  10. - "8010:8010"
  11. volumes:
  12. # 持久化数据和模型
  13. - ./data:/root/Fine-tuning/backend/data
  14. env_file:
  15. - ./backend/.env.docker
  16. environment:
  17. - BACKEND_HOST=0.0.0.0
  18. - BACKEND_PORT=8010
  19. # 沐曦 maca 环境变量
  20. - MACA_PATH=/opt/maca
  21. - LD_LIBRARY_PATH=/opt/maca/lib:/opt/maca/mxgpu_llvm/lib:/opt/maca/ompi/lib
  22. - MACA_CLANG_PATH=/opt/maca/mxgpu_llvm/bin
  23. devices:
  24. - /dev/mxcd:/dev/mxcd
  25. privileged: true
  26. networks:
  27. - finetune-net
  28. frontend:
  29. build:
  30. context: ./frontend
  31. dockerfile: Dockerfile
  32. args:
  33. VITE_API_BASE_URL: /api/v1
  34. VITE_WS_BASE_URL: /ws
  35. container_name: finetune-frontend
  36. restart: unless-stopped
  37. ports:
  38. - "3000:80"
  39. depends_on:
  40. - backend
  41. networks:
  42. - finetune-net
  43. networks:
  44. finetune-net:
  45. driver: bridge