docker-compose.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. - BACKEND_CORS_ORIGINS=http://localhost
  20. # 沐曦 maca 环境变量
  21. - MACA_PATH=/opt/maca
  22. - LD_LIBRARY_PATH=/opt/maca/lib:/opt/maca/mxgpu_llvm/lib:/opt/maca/ompi/lib
  23. - MACA_CLANG_PATH=/opt/maca/mxgpu_llvm/bin
  24. devices:
  25. - /dev/mxcd:/dev/mxcd
  26. privileged: true
  27. networks:
  28. - finetune-net
  29. frontend:
  30. build:
  31. context: ./frontend
  32. dockerfile: Dockerfile
  33. args:
  34. VITE_API_BASE_URL: /api/v1
  35. VITE_WS_BASE_URL: /ws
  36. container_name: finetune-frontend
  37. restart: unless-stopped
  38. ports:
  39. - "80:80"
  40. depends_on:
  41. - backend
  42. networks:
  43. - finetune-net
  44. networks:
  45. finetune-net:
  46. driver: bridge