Files
BetterDesk/docker-compose.single.yml
T
UNITRONIX 60657da980 Add Address Book API, relay env & UI fixes
Implement address book support and related fixes: add address_books table and Get/SaveAddressBook to DB interface with SQLite/Postgres migrations and upsert, add handlers for /api/ab, /api/ab/personal and /api/ab/tags (GET/POST) and normalize/limit incoming data. Signal server: generate relay UUIDs, send RelayResponse (with UUID and signed PK) and forward RequestRelay to targets to ensure hbbr pairing. Docker/compose/supervisord/entrypoint: introduce RELAY_SERVERS env, expose it in Dockerfile and supervisord, add docker-compose hint, and add entrypoint auto-detection/warnings for public IP inside containers. Web UI fixes: align settings password field names and include confirmPassword, modal input supports inputType, fix change-id request body key, add i18n strings for device actions/errors, and improve device delete route error handling. Also update changelog (.github/copilot-instructions.md) and add some API logging and validations.
2026-03-16 22:30:44 +01:00

124 lines
3.8 KiB
YAML

# BetterDesk — Simplified Docker Compose (Single Container)
# ===========================================================
#
# All-in-one: Go server + Node.js console in a single container.
#
# Quick start (SQLite — default):
# docker compose -f docker-compose.single.yml up -d --build
#
# With PostgreSQL:
# DB_TYPE=postgres DATABASE_URL=postgres://betterdesk:betterdesk@postgres:5432/betterdesk \
# docker compose -f docker-compose.single.yml --profile postgres up -d --build
#
# Or create a .env file:
# DB_TYPE=postgres
# DATABASE_URL=postgres://betterdesk:betterdesk@postgres:5432/betterdesk
# PG_PASSWORD=betterdesk
# Then: docker compose -f docker-compose.single.yml --profile postgres up -d --build
#
# Access:
# Web Console: http://localhost:5000
# Default login: admin / admin
services:
# BetterDesk All-in-One (Go server + Node.js console)
betterdesk:
build:
context: .
dockerfile: Dockerfile
image: betterdesk:local
pull_policy: never
container_name: betterdesk
hostname: betterdesk
ports:
- "5000:5000" # Web Console (LAN)
- "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
- "21121:21121" # RustDesk Client API (WAN)
volumes:
- betterdesk-data:/opt/rustdesk
- console-data:/app/data
environment:
- NODE_ENV=production
- PORT=5000
- HOST=0.0.0.0
- API_HOST=0.0.0.0
- ENCRYPTED_ONLY=1
- SERVER_BACKEND=betterdesk
- HBBS_API_URL=http://127.0.0.1:21114/api
- BETTERDESK_API_URL=http://127.0.0.1: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:-}
- DOCKER=true
# Database — defaults to SQLite; set via .env or command line for PostgreSQL
- DB_TYPE=${DB_TYPE:-sqlite}
- DATABASE_URL=${DATABASE_URL:-}
- DB_URL=${DATABASE_URL:-}
# Relay server address (public IP or domain).
# Auto-detected if not set. MUST be set if auto-detection returns
# Docker internal IP (172.x.x.x) — remote relay connections will fail otherwise.
- RELAY_SERVERS=${RELAY_SERVERS:-}
# Admin credentials (first run only):
# - ADMIN_USERNAME=admin
# - ADMIN_PASSWORD=YourSecurePassword123
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:21114/api/health && curl -sf http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 45s
# PostgreSQL (optional — use with --profile postgres)
postgres:
image: postgres:16-alpine
container_name: betterdesk-postgres
environment:
- POSTGRES_USER=betterdesk
- POSTGRES_PASSWORD=${PG_PASSWORD:-betterdesk}
- POSTGRES_DB=betterdesk
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U betterdesk"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- postgres
# Nginx Reverse Proxy (optional — use 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
restart: unless-stopped
depends_on:
- betterdesk
profiles:
- nginx
volumes:
betterdesk-data:
console-data:
postgres-data:
networks:
default:
name: betterdesk-net