docker-compose.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. environment:
  66. - TZ=${TZ:-Europe/Berlin}
  67. # User/group the container drops to after the entrypoint normalises
  68. # ownership on /app/data and /app/logs. Match your host user (run
  69. # `id -u` / `id -g`) if you want files written by the container to
  70. # show up as your user on the host. Defaults to 1000:1000.
  71. - PUID=${PUID:-1000}
  72. - PGID=${PGID:-1000}
  73. # Port BamBuddy runs on (default: 8000)
  74. # Usage: PORT=8080 docker compose up -d
  75. - PORT=${PORT:-8000}
  76. # Virtual printer: Set to the Docker host's IP when using bridge mode (ports:).
  77. # Required for FTP passive mode to work behind NAT.
  78. # Example: VIRTUAL_PRINTER_PASV_ADDRESS=192.168.1.100
  79. #- VIRTUAL_PRINTER_PASV_ADDRESS=
  80. #
  81. # External PostgreSQL (optional — uses SQLite by default)
  82. # Example: DATABASE_URL=postgresql+asyncpg://bambuddy:password@db-host:5432/bambuddy
  83. #- DATABASE_URL=
  84. #
  85. # Slicer API sidecar (optional — Settings → "Use Slicer API" toggles this on).
  86. # Default points at the OrcaSlicer sidecar on the docker host; change if you
  87. # run the sidecar on a different host/port. The matching docker-compose.yml
  88. # for the sidecars lives in the orca-slicer-api fork
  89. # (https://github.com/maziggy/orca-slicer-api).
  90. #- SLICER_API_URL=http://localhost:3003
  91. #
  92. # MFA at-rest encryption key (#1219). Auto-generated to
  93. # DATA_DIR/.mfa_encryption_key on first startup if unset. Override here
  94. # to manage the key out-of-band (e.g. via a secret manager).
  95. #- MFA_ENCRYPTION_KEY=
  96. restart: unless-stopped
  97. # Optional: External PostgreSQL database
  98. # Uncomment to run Postgres alongside Bambuddy (or use an external Postgres host)
  99. #postgres:
  100. # image: postgres:16-alpine
  101. # container_name: bambuddy-db
  102. # restart: unless-stopped
  103. # environment:
  104. # POSTGRES_USER: bambuddy
  105. # POSTGRES_PASSWORD: changeme
  106. # POSTGRES_DB: bambuddy
  107. # volumes:
  108. # - bambuddy_pgdata:/var/lib/postgresql/data
  109. # ports:
  110. # - "5432:5432"
  111. volumes:
  112. bambuddy_data:
  113. bambuddy_logs:
  114. #bambuddy_pgdata: