docker-compose.yml 4.4 KB

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