mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 17:45:42 +00:00
2d6b730f99
Add Docker quickstart flow and CI to publish images to GitHub Container Registry. Creates a new GitHub Actions workflow (.github/workflows/docker-publish.yml) that builds multi-arch images (server, console, all-in-one) and pushes to ghcr.io. Adds docker-compose.quick.yml using pre-built GHCR images and a DOCKER_QUICKSTART.md with a 30s one‑line quick start, troubleshooting, and configuration notes. Update README Docker section to surface the quick start and adjust docker-compose.yml header to reference the quick file. Also update .github/copilot-instructions.md to document the Docker quick start and publishing phase.
133 lines
4.0 KiB
YAML
133 lines
4.0 KiB
YAML
# BetterDesk Console - Docker Compose Setup
|
|
# Architecture: Go server (single binary) + Node.js web console
|
|
#
|
|
# ============================================================================
|
|
# QUICK START (no build required):
|
|
# curl -fsSL https://raw.githubusercontent.com/UNITRONIX/Rustdesk-FreeConsole/main/docker-compose.quick.yml -o docker-compose.yml
|
|
# docker compose up -d
|
|
#
|
|
# BUILD FROM SOURCE (this file):
|
|
# docker compose build && docker compose up -d
|
|
# ============================================================================
|
|
#
|
|
# The Go server replaces separate hbbs/hbbr — it handles signal, relay,
|
|
# and HTTP API in a single process.
|
|
|
|
services:
|
|
# BetterDesk Server (Go) — replaces hbbs + hbbr
|
|
# Single binary: signal (21116), relay (21117), API (21114), NAT test (21115)
|
|
server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.server
|
|
image: betterdesk-server:local
|
|
pull_policy: never
|
|
container_name: betterdesk-server
|
|
hostname: betterdesk-server
|
|
command: ["/usr/local/bin/betterdesk-server", "-mode", "all", "-key-file", "/opt/rustdesk/id_ed25519"]
|
|
ports:
|
|
- "21114:21114" # HTTP API
|
|
- "21115:21115" # NAT type test
|
|
- "21116:21116/tcp" # Signal TCP
|
|
- "21116:21116/udp" # Signal UDP
|
|
- "21117:21117" # Relay TCP
|
|
- "21118:21118" # WebSocket Signal
|
|
- "21119:21119" # WebSocket Relay
|
|
volumes:
|
|
- rustdesk-data:/opt/rustdesk
|
|
environment:
|
|
- ENCRYPTED_ONLY=1
|
|
- DB_URL=${DB_URL:-/opt/rustdesk/db_v2.sqlite3}
|
|
networks:
|
|
- betterdesk-net
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sf", "http://localhost:21114/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
# BetterDesk Console — Node.js Web Interface
|
|
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
|
|
- "21121:21121" # RustDesk Client API (WAN)
|
|
volumes:
|
|
- rustdesk-data:/opt/rustdesk:ro # Read-only access to server data (keys, db)
|
|
- console-data:/app/data # Console-specific data (auth.db, sessions)
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=5000
|
|
- SERVER_BACKEND=betterdesk
|
|
- HBBS_API_URL=http://betterdesk-server:21114/api
|
|
- BETTERDESK_API_URL=http://betterdesk-server:21114/api
|
|
- RUSTDESK_PATH=/opt/rustdesk
|
|
- DATA_DIR=/app/data
|
|
- DB_PATH=/opt/rustdesk/db_v2.sqlite3
|
|
- PUB_KEY_PATH=/opt/rustdesk/id_ed25519.pub
|
|
- API_KEY_PATH=/opt/rustdesk/.api_key
|
|
- SESSION_SECRET=${SESSION_SECRET:-}
|
|
- WS_HBBS_HOST=betterdesk-server
|
|
- WS_HBBS_PORT=21116
|
|
- WS_HBBR_HOST=betterdesk-server
|
|
- WS_HBBR_PORT=21117
|
|
- DOCKER=true
|
|
# Optional: Set custom admin credentials for first run
|
|
# - ADMIN_USERNAME=admin
|
|
# - ADMIN_PASSWORD=YourSecurePassword123
|
|
networks:
|
|
- betterdesk-net
|
|
restart: unless-stopped
|
|
depends_on:
|
|
server:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sf", "http://localhost:5000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
# Nginx Reverse Proxy (Optional — only with --profile nginx)
|
|
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:
|
|
- console
|
|
profiles:
|
|
- nginx
|
|
|
|
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 |