docker-compose.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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://183.220.37.46:8010/api/v1
  50. VITE_WS_BASE_URL: ws://183.220.37.46:8010/ws
  51. container_name: finetune-frontend
  52. restart: unless-stopped
  53. ports:
  54. - "23423:80"
  55. depends_on:
  56. - backend
  57. networks:
  58. - finetune-net
  59. networks:
  60. finetune-net:
  61. driver: bridge
  62. volumes:
  63. pgdata: