docker-compose.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. # File ownership inside the data and logs volumes is normalised by the
  10. # entrypoint at startup (chowns to PUID:PGID and drops privileges via
  11. # gosu before running the app). Override PUID / PGID below to match
  12. # your host user if needed — defaults to 1000:1000 to match the
  13. # historical compose `user:` directive.
  14. #
  15. # Allow binding to privileged ports (322, 990) as non-root user — required
  16. # for FTPS in every VP mode and for the RTSPS camera proxy in proxy mode +
  17. # non-proxy modes that have a target printer configured. Without this, the
  18. # FTP and RTSP listeners silently fail.
  19. cap_add:
  20. - NET_BIND_SERVICE
  21. #
  22. # LINUX: Use host mode for printer discovery and camera streaming
  23. network_mode: host
  24. #
  25. # macOS/WINDOWS: Docker Desktop doesn't support host mode.
  26. # Comment out "network_mode: host" above and uncomment "ports:" below.
  27. # Note: Printer discovery won't work - add printers manually by IP.
  28. #ports:
  29. # - "${PORT:-8000}:8000"
  30. # - "3000:3000" # Virtual printer bind/detect
  31. # - "3002:3002" # Virtual printer bind/detect
  32. # - "8883:8883" # Virtual printer MQTT
  33. # - "990:990" # Virtual printer FTP control
  34. # - "6000:6000" # Virtual printer file transfer tunnel
  35. # - "322:322" # Virtual printer RTSP camera (X1/H2/P2; proxy mode + non-proxy modes with a target printer)
  36. # - "2024-2026:2024-2026" # Virtual printer proprietary ports (A1/P1S)
  37. # - "50000-51000:50000-51000" # Virtual printer FTP passive data (widened from 50000-50100 for multi-VP headroom)
  38. #
  39. # ⚠️ Bridge-mode + Docker's default userland proxy: the 1001-port FTP
  40. # passive range spawns ~2000 docker-proxy host processes (IPv4+IPv6
  41. # × 1001 ports), each pinning ~3.5 MB of host RAM, for a ~3.5 GB
  42. # footprint that doesn't show up in `docker stats` because it's
  43. # host-level, not container-level (#1646). Linux's host-mode default
  44. # above sidesteps this entirely. If you genuinely need bridge mode
  45. # (e.g. Docker Desktop on macOS/Windows), set
  46. # { "userland-proxy": false }
  47. # in /etc/docker/daemon.json and restart Docker. Confirmed to clear
  48. # the issue by the reporter; the kernel does NAT directly via
  49. # iptables/nftables, no per-port host process needed. Only side-
  50. # effect is that connections originating from 127.0.0.1 on the host
  51. # itself can't reach the container — fine for nearly every
  52. # Bambuddy install.
  53. volumes:
  54. - bambuddy_data:/app/data
  55. - bambuddy_logs:/app/logs
  56. #
  57. # OPTIONAL — only needed if you ALSO run a native install of Bambuddy
  58. # on the same host and want both installs to share the same Virtual
  59. # Printer CA certificate (so the slicer only has to trust one CA).
  60. # Most Docker-only users should leave this commented out — the
  61. # entrypoint will keep the VP data inside the named volume above.
  62. # If uncommented, the entrypoint chowns the host directory to
  63. # PUID:PGID on first start so the container user can write to it.
  64. #- ./virtual_printer:/app/data/virtual_printer
  65. #
  66. # Mount scheduled backup output to NAS or external storage
  67. # Backups default to DATA_DIR/backups/ inside the data volume.
  68. # Uncomment to store them externally (e.g. on a NAS share).
  69. #- /path/to/nas/bambuddy-backups:/app/data/backups
  70. #
  71. # Tailscale integration (optional): mount the host's tailscaled socket
  72. # so Bambuddy can request Let's Encrypt certs for virtual printers via
  73. # your tailnet's MagicDNS name. Requires:
  74. # 1. Tailscale installed + `tailscale up` completed on the host
  75. # 2. `sudo tailscale set --operator=<container-user>` on the host so
  76. # the user running the container can call `tailscale cert`
  77. # Without this mount, the Tailscale toggle in the UI is harmless —
  78. # Bambuddy falls back to self-signed certs.
  79. #- /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock
  80. #
  81. # Using a self signed certificate for Home Assistant
  82. # Add your certificate to certs directory and mount it to the container.
  83. # The certificate will be added to the system trust store on container startup.
  84. # Enable the system trust store with the USE_SYSTEM_TRUST_STORE env var to
  85. # have Bambuddy trust the certificate.
  86. # - /path/to/certs:/usr/local/share/ca-certificates
  87. #
  88. # External library folders. Mount the host paths the operator wants
  89. # users to be able to register as external folders. The in-container
  90. # paths chosen here MUST appear in BAMBUDDY_EXTERNAL_ROOTS below.
  91. # Read-only (:ro) is recommended unless you want users uploading
  92. # files back to the host share.
  93. #- /mnt/nas/3d-prints:/external/nas:ro
  94. #- /srv/library:/external/projects:ro
  95. environment:
  96. - TZ=${TZ:-Europe/Berlin}
  97. # User/group the container drops to after the entrypoint normalises
  98. # ownership on /app/data and /app/logs. Match your host user (run
  99. # `id -u` / `id -g`) if you want files written by the container to
  100. # show up as your user on the host. Defaults to 1000:1000.
  101. - PUID=${PUID:-1000}
  102. - PGID=${PGID:-1000}
  103. # Port BamBuddy runs on (default: 8000)
  104. # Usage: PORT=8080 docker compose up -d
  105. - PORT=${PORT:-8000}
  106. # Virtual printer: Set to the Docker host's IP when using bridge mode (ports:).
  107. # Required for FTP passive mode to work behind NAT.
  108. # Example: VIRTUAL_PRINTER_PASV_ADDRESS=192.168.1.100
  109. #- VIRTUAL_PRINTER_PASV_ADDRESS=
  110. #
  111. # External PostgreSQL (optional — uses SQLite by default)
  112. # Example: DATABASE_URL=postgresql+asyncpg://bambuddy:password@db-host:5432/bambuddy
  113. #- DATABASE_URL=
  114. #
  115. # Slicer API sidecar (optional — Settings → "Use Slicer API" toggles this on).
  116. # Default points at the OrcaSlicer sidecar on the docker host; change if you
  117. # run the sidecar on a different host/port. The matching docker-compose.yml
  118. # for the sidecars lives in the orca-slicer-api fork
  119. # (https://github.com/maziggy/orca-slicer-api).
  120. #- SLICER_API_URL=http://localhost:3003
  121. #
  122. # MFA at-rest encryption key (#1219). Auto-generated to
  123. # DATA_DIR/.mfa_encryption_key on first startup if unset. Override here
  124. # to manage the key out-of-band (e.g. via a secret manager).
  125. #- MFA_ENCRYPTION_KEY=
  126. #
  127. # External library folders (GHSA-r2qv follow-up). Empty default
  128. # disables the "Add external folder" feature; set to one or more
  129. # colon-separated absolute paths INSIDE THE CONTAINER to opt in.
  130. # The paths must also be bind-mounted from the host — uncomment
  131. # the matching volume snippet below.
  132. # Example for a single NAS mount:
  133. #- BAMBUDDY_EXTERNAL_ROOTS=/external/nas
  134. # Example for two roots:
  135. #- BAMBUDDY_EXTERNAL_ROOTS=/external/nas:/external/projects
  136. #
  137. # Enable System Trust Store for certificate validation (e.g. for local Home Assistant)
  138. # You also need to mount your certificates to the container (see volumes section above).
  139. # - USE_SYSTEM_TRUST_STORE=true
  140. restart: unless-stopped
  141. # Optional: External PostgreSQL database
  142. # Uncomment to run Postgres alongside Bambuddy (or use an external Postgres host)
  143. #postgres:
  144. # image: postgres:16-alpine
  145. # container_name: bambuddy-db
  146. # restart: unless-stopped
  147. # environment:
  148. # POSTGRES_USER: bambuddy
  149. # POSTGRES_PASSWORD: changeme
  150. # POSTGRES_DB: bambuddy
  151. # volumes:
  152. # - bambuddy_pgdata:/var/lib/postgresql/data
  153. # ports:
  154. # - "5432:5432"
  155. volumes:
  156. bambuddy_data:
  157. bambuddy_logs:
  158. #bambuddy_pgdata: