docker-compose.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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-50100:50000-50100" # Virtual printer FTP passive data
  38. volumes:
  39. - bambuddy_data:/app/data
  40. - bambuddy_logs:/app/logs
  41. #
  42. # OPTIONAL — only needed if you ALSO run a native install of Bambuddy
  43. # on the same host and want both installs to share the same Virtual
  44. # Printer CA certificate (so the slicer only has to trust one CA).
  45. # Most Docker-only users should leave this commented out — the
  46. # entrypoint will keep the VP data inside the named volume above.
  47. # If uncommented, the entrypoint chowns the host directory to
  48. # PUID:PGID on first start so the container user can write to it.
  49. #- ./virtual_printer:/app/data/virtual_printer
  50. #
  51. # Mount scheduled backup output to NAS or external storage
  52. # Backups default to DATA_DIR/backups/ inside the data volume.
  53. # Uncomment to store them externally (e.g. on a NAS share).
  54. #- /path/to/nas/bambuddy-backups:/app/data/backups
  55. #
  56. # Tailscale integration (optional): mount the host's tailscaled socket
  57. # so Bambuddy can request Let's Encrypt certs for virtual printers via
  58. # your tailnet's MagicDNS name. Requires:
  59. # 1. Tailscale installed + `tailscale up` completed on the host
  60. # 2. `sudo tailscale set --operator=<container-user>` on the host so
  61. # the user running the container can call `tailscale cert`
  62. # Without this mount, the Tailscale toggle in the UI is harmless —
  63. # Bambuddy falls back to self-signed certs.
  64. #- /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock
  65. #
  66. # Using a self signed certificate for Home Assistant
  67. # Add your certificate to certs directory and mount it to the container.
  68. # The certificate will be added to the system trust store on container startup.
  69. # Enable the system trust store with the USE_SYSTEM_TRUST_STORE env var to
  70. # have Bambuddy trust the certificate.
  71. # - /path/to/certs:/usr/local/share/ca-certificates
  72. environment:
  73. - TZ=${TZ:-Europe/Berlin}
  74. # User/group the container drops to after the entrypoint normalises
  75. # ownership on /app/data and /app/logs. Match your host user (run
  76. # `id -u` / `id -g`) if you want files written by the container to
  77. # show up as your user on the host. Defaults to 1000:1000.
  78. - PUID=${PUID:-1000}
  79. - PGID=${PGID:-1000}
  80. # Port BamBuddy runs on (default: 8000)
  81. # Usage: PORT=8080 docker compose up -d
  82. - PORT=${PORT:-8000}
  83. # Virtual printer: Set to the Docker host's IP when using bridge mode (ports:).
  84. # Required for FTP passive mode to work behind NAT.
  85. # Example: VIRTUAL_PRINTER_PASV_ADDRESS=192.168.1.100
  86. #- VIRTUAL_PRINTER_PASV_ADDRESS=
  87. #
  88. # External PostgreSQL (optional — uses SQLite by default)
  89. # Example: DATABASE_URL=postgresql+asyncpg://bambuddy:password@db-host:5432/bambuddy
  90. #- DATABASE_URL=
  91. #
  92. # Slicer API sidecar (optional — Settings → "Use Slicer API" toggles this on).
  93. # Default points at the OrcaSlicer sidecar on the docker host; change if you
  94. # run the sidecar on a different host/port. The matching docker-compose.yml
  95. # for the sidecars lives in the orca-slicer-api fork
  96. # (https://github.com/maziggy/orca-slicer-api).
  97. #- SLICER_API_URL=http://localhost:3003
  98. #
  99. # MFA at-rest encryption key (#1219). Auto-generated to
  100. # DATA_DIR/.mfa_encryption_key on first startup if unset. Override here
  101. # to manage the key out-of-band (e.g. via a secret manager).
  102. #- MFA_ENCRYPTION_KEY=
  103. #
  104. # Enable System Trust Store for certificate validation (e.g. for local Home Assistant)
  105. # You also need to mount your certificates to the container (see volumes section above).
  106. # - USE_SYSTEM_TRUST_STORE=true
  107. restart: unless-stopped
  108. # Optional: External PostgreSQL database
  109. # Uncomment to run Postgres alongside Bambuddy (or use an external Postgres host)
  110. #postgres:
  111. # image: postgres:16-alpine
  112. # container_name: bambuddy-db
  113. # restart: unless-stopped
  114. # environment:
  115. # POSTGRES_USER: bambuddy
  116. # POSTGRES_PASSWORD: changeme
  117. # POSTGRES_DB: bambuddy
  118. # volumes:
  119. # - bambuddy_pgdata:/var/lib/postgresql/data
  120. # ports:
  121. # - "5432:5432"
  122. volumes:
  123. bambuddy_data:
  124. bambuddy_logs:
  125. #bambuddy_pgdata: