docker-compose.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. version: "3.8"
  2. services:
  3. postgres:
  4. image: postgres:16-alpine
  5. container_name: finetune-postgres
  6. restart: unless-stopped
  7. environment:
  8. POSTGRES_DB: finetuning
  9. POSTGRES_USER: finetune
  10. POSTGRES_PASSWORD: finetune123
  11. volumes:
  12. - pgdata:/var/lib/postgresql/data
  13. ports:
  14. - "5432:5432"
  15. networks:
  16. - finetune-net
  17. backend:
  18. build:
  19. context: ./backend
  20. dockerfile: Dockerfile
  21. container_name: finetune-backend
  22. restart: unless-stopped
  23. ports:
  24. - "8010:8010"
  25. volumes:
  26. # 持久化数据和模型
  27. - ./backend/data:/root/Fine-tuning/backend/data
  28. env_file:
  29. - ./backend/.env.docker
  30. environment:
  31. - BACKEND_HOST=0.0.0.0
  32. - BACKEND_PORT=8010
  33. - DATABASE_URL=postgresql+asyncpg://finetune:finetune123@postgres:5432/finetuning
  34. # 沐曦 maca 环境变量
  35. - MACA_PATH=/opt/maca
  36. - LD_LIBRARY_PATH=/opt/maca/lib:/opt/maca/mxgpu_llvm/lib:/opt/maca/ompi/lib
  37. - MACA_CLANG_PATH=/opt/maca/mxgpu_llvm/bin
  38. depends_on:
  39. - postgres
  40. devices:
  41. - /dev/mxcd:/dev/mxcd
  42. privileged: true
  43. shm_size: "2gb"
  44. networks:
  45. - finetune-net
  46. frontend:
  47. build:
  48. context: ./frontend
  49. dockerfile: Dockerfile
  50. args:
  51. VITE_API_BASE_URL: /api/v1
  52. VITE_WS_BASE_URL: /ws
  53. container_name: finetune-frontend
  54. restart: unless-stopped
  55. ports:
  56. - "3000:80"
  57. depends_on:
  58. - backend
  59. networks:
  60. - finetune-net
  61. networks:
  62. finetune-net:
  63. driver: bridge
  64. volumes:
  65. pgdata: