Files
BetterDesk/docker-compose.yml
T
UNITRONIX 18dac36661 Use local BetterDesk binaries; fix Docker build
Update Dockerfiles and compose to use local BetterDesk (hbbs-patch-v2) binaries, avoid pulling unpublished images, and improve build reliability. Dockerfile.hbbr/hbbs now copy patched binaries, set executable symlinks and run the BetterDesk binaries by default. Dockerfile.console adds DNS fallback entries to mitigate resolver failures during build. docker-compose.yml sets image names and pull_policy: never and runs the enhanced binaries directly. Documentation updated (DOCKER_TROUBLESHOOTING.md, README, .github/copilot-instructions.md) with troubleshooting steps for "no such table: peer", pull access denied, and DNS build issues.
2026-02-06 20:28:28 +01:00

140 lines
4.1 KiB
YAML

# BetterDesk Console - Docker Compose Setup
# This is a complete Docker setup that includes RustDesk servers and BetterDesk Console
# IMPORTANT: Images must be built locally - do NOT try to pull from Docker Hub!
# Use: docker compose build && docker compose up -d
version: '3.8'
services:
# RustDesk HBBS (Signal Server) with BetterDesk API
# Built from Dockerfile.hbbs with BetterDesk enhanced binaries
hbbs:
build:
context: .
dockerfile: Dockerfile.hbbs
image: betterdesk-hbbs:local
pull_policy: never
container_name: betterdesk-hbbs
hostname: betterdesk-hbbs
# BetterDesk binary with HTTP API enabled on port 21114
command: ["/usr/local/bin/hbbs-betterdesk", "-k", "_", "--api-port", "21114"]
ports:
- "21115:21115" # TCP hole punching
- "21116:21116/tcp" # TCP relay
- "21116:21116/udp" # UDP hole punching
- "21114:21114" # HTTP API (BetterDesk)
volumes:
- rustdesk-data:/root # RustDesk data persistence
environment:
- ALWAYS_USE_RELAY=N
- ENCRYPTED_ONLY=1
networks:
- betterdesk-net
restart: unless-stopped
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "21116"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# RustDesk HBBR (Relay Server) with BetterDesk
# Built from Dockerfile.hbbr with BetterDesk enhanced binaries
hbbr:
build:
context: .
dockerfile: Dockerfile.hbbr
image: betterdesk-hbbr:local
pull_policy: never
container_name: betterdesk-hbbr
hostname: betterdesk-hbbr
# BetterDesk relay binary
command: ["/usr/local/bin/hbbr-betterdesk", "-k", "_"]
ports:
- "21117:21117" # Relay port
volumes:
- rustdesk-data:/root # Shared data with HBBS
networks:
- betterdesk-net
restart: unless-stopped
depends_on:
hbbs:
condition: service_healthy
# BetterDesk Console Web Interface
betterdesk-console:
build:
context: .
dockerfile: Dockerfile.console
image: betterdesk-console:local
pull_policy: never
container_name: betterdesk-console
hostname: betterdesk-console
ports:
- "5000:5000" # Web console port
volumes:
- rustdesk-data:/opt/rustdesk:ro # Read-only access to RustDesk data
- console-data:/app/data # Console-specific data
environment:
- DB_PATH=/opt/rustdesk/db_v2.sqlite3
- API_KEY_PATH=/opt/rustdesk/.api_key
- PUB_KEY_PATH=/opt/rustdesk/id_ed25519.pub
- HBBS_API_URL=http://hbbs:21114/api
- FLASK_SECRET_KEY=${FLASK_SECRET_KEY:-$(openssl rand -hex 32)}
- FLASK_ENV=production
# Optional: Set custom admin credentials (remove to use auto-generated)
# - ADMIN_USERNAME=admin
# - ADMIN_PASSWORD=YourSecurePassword123
# - SKIP_AUTO_MIGRATION=false
networks:
- betterdesk-net
restart: unless-stopped
depends_on:
- hbbs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Nginx Reverse Proxy (Optional)
nginx:
image: nginx:alpine
container_name: betterdesk-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
networks:
- betterdesk-net
restart: unless-stopped
depends_on:
- betterdesk-console
profiles:
- nginx # Only start with: docker-compose --profile nginx up
volumes:
rustdesk-data:
driver: local
driver_opts:
type: none
o: bind
device: ${RUSTDESK_DATA_PATH:-./data}
console-data:
driver: local
networks:
betterdesk-net:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
# Security Notice:
# - Watchtower has been removed (archived project - security risk)
# - For updates, manually pull new images: docker-compose pull && docker-compose up -d
# - Or use modern alternatives like Renovate, Dependabot, or manual update scripts