docker-compose.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. version: "3.8"
  2. services:
  3. postgres:
  4. image: docker.m.daocloud.io/library/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. network_mode: host
  16. backend:
  17. build:
  18. context: ./backend
  19. dockerfile: Dockerfile
  20. container_name: finetune-backend
  21. restart: unless-stopped
  22. ports:
  23. - "8010:8010"
  24. volumes:
  25. - ./backend/data:/home/ubuntu/Fine-tuning/backend/data
  26. env_file:
  27. - ./backend/.env
  28. environment:
  29. - BACKEND_HOST=0.0.0.0
  30. - BACKEND_PORT=8010
  31. - DATABASE_URL=postgresql+asyncpg://finetune:finetune123@localhost:5432/finetuning
  32. deploy:
  33. resources:
  34. reservations:
  35. devices:
  36. - driver: nvidia
  37. count: all
  38. capabilities: [gpu]
  39. network_mode: host
  40. depends_on:
  41. - postgres
  42. frontend:
  43. build:
  44. context: ./frontend
  45. dockerfile: Dockerfile
  46. args:
  47. VITE_API_BASE_URL: http://localhost:8010/api/v1
  48. VITE_WS_BASE_URL: ws://localhost:8010/ws
  49. container_name: finetune-frontend
  50. restart: unless-stopped
  51. ports:
  52. - "5173:80"
  53. volumes:
  54. pgdata: