docker-compose.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. version: '3.8'
  2. services:
  3. livetalking:
  4. build:
  5. context: .
  6. dockerfile: Dockerfile
  7. image: livetalking:latest
  8. container_name: livetalking
  9. ports:
  10. - "7860:7860"
  11. - "8080:8080"
  12. volumes:
  13. - ./models:/app/models
  14. - ./data:/app/data
  15. - ./LivePortrait-main/pretrained_weights:/app/LivePortrait-main/pretrained_weights
  16. environment:
  17. - CUDA_VISIBLE_DEVICES=0
  18. - PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512
  19. deploy:
  20. resources:
  21. reservations:
  22. devices:
  23. - driver: nvidia
  24. count: 1
  25. capabilities: [gpu]
  26. restart: unless-stopped
  27. networks:
  28. - livetalking-network
  29. # 可选:nginx反向代理
  30. nginx:
  31. image: nginx:latest
  32. container_name: livetalking-nginx
  33. ports:
  34. - "80:80"
  35. - "443:443"
  36. volumes:
  37. - ./nginx.conf:/etc/nginx/nginx.conf:ro
  38. depends_on:
  39. - livetalking
  40. restart: unless-stopped
  41. networks:
  42. - livetalking-network
  43. networks:
  44. livetalking-network:
  45. driver: bridge