docker-compose.yml 1.4 KB

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