docker-compose.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. services:
  2. bambuddy:
  3. image: ghcr.io/maziggy/bambuddy:latest
  4. build: .
  5. # Usage:
  6. # docker compose up -d → pulls pre-built image from ghcr.io
  7. # docker compose up -d --build → builds locally from source
  8. container_name: bambuddy
  9. # Run as current user to avoid permission issues with mounted volumes
  10. # Override with: PUID=$(id -u) PGID=$(id -g) docker compose up -d
  11. user: "${PUID:-1000}:${PGID:-1000}"
  12. #
  13. # Proxy mode: allow binding to privileged ports (322, 990) as non-root user.
  14. # Without this, the FTP and RTSP proxies silently fail.
  15. cap_add:
  16. - NET_BIND_SERVICE
  17. #
  18. # LINUX: Use host mode for printer discovery and camera streaming
  19. network_mode: host
  20. #
  21. # macOS/WINDOWS: Docker Desktop doesn't support host mode.
  22. # Comment out "network_mode: host" above and uncomment "ports:" below.
  23. # Note: Printer discovery won't work - add printers manually by IP.
  24. #ports:
  25. # - "${PORT:-8000}:8000"
  26. # - "3000:3000" # Virtual printer bind/detect
  27. # - "3002:3002" # Virtual printer bind/detect
  28. # - "8883:8883" # Virtual printer MQTT
  29. # - "990:990" # Virtual printer FTP control
  30. # - "6000:6000" # Virtual printer file transfer tunnel
  31. # - "322:322" # Virtual printer RTSP camera (X1/H2/P2)
  32. # - "2024-2026:2024-2026" # Virtual printer proprietary ports (A1/P1S)
  33. # - "50000-50100:50000-50100" # Virtual printer FTP passive data
  34. volumes:
  35. - bambuddy_data:/app/data
  36. - bambuddy_logs:/app/logs
  37. #
  38. # Share virtual printer certs with native installation
  39. # This ensures the slicer only needs to trust one CA certificate.
  40. - ./virtual_printer:/app/data/virtual_printer
  41. #
  42. # Mount scheduled backup output to NAS or external storage
  43. # Backups default to DATA_DIR/backups/ inside the data volume.
  44. # Uncomment to store them externally (e.g. on a NAS share).
  45. #- /path/to/nas/bambuddy-backups:/app/data/backups
  46. #
  47. # Tailscale integration (optional): mount the host's tailscaled socket
  48. # so Bambuddy can request Let's Encrypt certs for virtual printers via
  49. # your tailnet's MagicDNS name. Requires:
  50. # 1. Tailscale installed + `tailscale up` completed on the host
  51. # 2. `sudo tailscale set --operator=<container-user>` on the host so
  52. # the user running the container can call `tailscale cert`
  53. # Without this mount, the Tailscale toggle in the UI is harmless —
  54. # Bambuddy falls back to self-signed certs.
  55. #- /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock
  56. environment:
  57. - TZ=${TZ:-Europe/Berlin}
  58. # Port BamBuddy runs on (default: 8000)
  59. # Usage: PORT=8080 docker compose up -d
  60. - PORT=${PORT:-8000}
  61. # Virtual printer: Set to the Docker host's IP when using bridge mode (ports:).
  62. # Required for FTP passive mode to work behind NAT.
  63. # Example: VIRTUAL_PRINTER_PASV_ADDRESS=192.168.1.100
  64. #- VIRTUAL_PRINTER_PASV_ADDRESS=
  65. #
  66. # External PostgreSQL (optional — uses SQLite by default)
  67. # Example: DATABASE_URL=postgresql+asyncpg://bambuddy:password@db-host:5432/bambuddy
  68. #- DATABASE_URL=
  69. #
  70. # Slicer API sidecar (optional — Settings → "Use Slicer API" toggles this on).
  71. # Default points at the OrcaSlicer sidecar on the docker host; change if you
  72. # run the sidecar on a different host/port. The matching docker-compose.yml
  73. # for the sidecars lives in the orca-slicer-api fork
  74. # (https://github.com/maziggy/orca-slicer-api).
  75. #- SLICER_API_URL=http://localhost:3003
  76. restart: unless-stopped
  77. # Optional: External PostgreSQL database
  78. # Uncomment to run Postgres alongside Bambuddy (or use an external Postgres host)
  79. #postgres:
  80. # image: postgres:16-alpine
  81. # container_name: bambuddy-db
  82. # restart: unless-stopped
  83. # environment:
  84. # POSTGRES_USER: bambuddy
  85. # POSTGRES_PASSWORD: changeme
  86. # POSTGRES_DB: bambuddy
  87. # volumes:
  88. # - bambuddy_pgdata:/var/lib/postgresql/data
  89. # ports:
  90. # - "5432:5432"
  91. volumes:
  92. bambuddy_data:
  93. bambuddy_logs:
  94. #bambuddy_pgdata: