docker-compose.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. services:
  2. spacedrive:
  3. build:
  4. context: .
  5. dockerfile: Dockerfile
  6. container_name: spacedrive-server
  7. restart: unless-stopped
  8. # Ports
  9. ports:
  10. - "8080:8080" # HTTP server
  11. - "7373:7373" # P2P networking
  12. # Volumes
  13. volumes:
  14. - spacedrive-data:/data
  15. # - /mnt/pshare:/storage/pshare:ro
  16. - /mnt/gshare/Users:/storage:ro
  17. # Environment variables
  18. environment:
  19. # Data directory (inside container)
  20. - DATA_DIR=/data
  21. # HTTP server port
  22. - PORT=8080
  23. # Authentication (REQUIRED for security!)
  24. # Format: "username:password,username2:password2"
  25. # Or set to "disabled" to disable auth (NOT RECOMMENDED)
  26. - SD_AUTH=${SD_AUTH:-admin:changeme}
  27. # Enable P2P networking
  28. - SD_P2P=true
  29. # Logging
  30. - RUST_LOG=info,sd_core=debug
  31. # Timezone
  32. - TZ=UTC
  33. # Health check
  34. healthcheck:
  35. test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
  36. interval: 30s
  37. timeout: 10s
  38. retries: 3
  39. start_period: 40s
  40. # Resource limits (adjust as needed)
  41. deploy:
  42. resources:
  43. limits:
  44. memory: 4G
  45. reservations:
  46. memory: 512M
  47. volumes:
  48. spacedrive-data:
  49. driver: local