Files
backend/docker-compose.yml
lan 14114db68d
All checks were successful
Build Backend / build (push) Successful in 3m47s
Build Backend / build-docker (push) Successful in 5m9s
feat(call): integrate LiveKit for voice and video calling
Replace the manual WebRTC signaling implementation with LiveKit SFU. This includes:
- Adding LiveKit service, handler, and configuration.
- Updating Docker Compose to include LiveKit server, Redis, and PostgreSQL.
- Refactoring `CallService` and `WSHandler` to support LiveKit room readiness instead of raw SDP/ICE relaying.
- Adding new API endpoints for LiveKit token generation and webhooks.
- Removing deprecated WebRTC configuration and manual signaling DTOs.
2026-06-01 13:41:02 +08:00

133 lines
3.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
# 开发环境使用 SQLite 和 miniredis不需要外部数据库服务
# 如需使用 PostgreSQL 和 Redis切换 config.yaml 中的配置并取消注释以下服务
# PostgreSQL (生产环境使用)
# postgres:
# image: postgres:15-alpine
# container_name: carrot_bbs_postgres
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: carrot_bbs
# ports:
# - "5432:5432"
# volumes:
# - postgres_data:/var/lib/postgresql/data
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U postgres"]
# interval: 10s
# timeout: 5s
# retries: 5
# Redis (生产环境使用)
# redis:
# image: redis:7-alpine
# container_name: carrot_bbs_redis
# ports:
# - "6379:6379"
# volumes:
# - redis_data:/data
# healthcheck:
# test: ["CMD", "redis-cli", "ping"]
# interval: 10s
# timeout: 5s
# retries: 5
# MinIO (对象存储,可选)
minio:
image: minio/minio:latest
container_name: carrot_bbs_minio
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# LiveKit SFU Server (voice/video calling)
livekit:
image: livekit/livekit-server:v1.9.5
container_name: livekit
ports:
- "7880:7880" # HTTP (token, webhooks, dashboard)
- "7881:7881" # TCP/TURN fallback
- "7882:7882" # UDP media
volumes:
- ./configs/livekit.yaml:/etc/livekit.yaml
command: --config /etc/livekit.yaml --node-ip=127.0.0.1
depends_on:
livekit-redis:
condition: service_started
livekit-postgres:
condition: service_healthy
restart: unless-stopped
# LiveKit Redis (required for distributed coordination)
livekit-redis:
image: redis:7-alpine
container_name: livekit_redis
ports:
- "6380:6379"
volumes:
- livekit_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# LiveKit PostgreSQL (required for room/participant state)
livekit-postgres:
image: postgres:16-alpine
container_name: livekit_postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: livekit
ports:
- "5433:5432"
volumes:
- livekit_pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d livekit"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
app:
build:
context: .
dockerfile: Dockerfile
container_name: carrot_bbs_app
ports:
- "8080:8080"
depends_on:
minio:
condition: service_healthy
environment:
- CONFIG_PATH=/app/configs/config.yaml
volumes:
- ./configs:/app/configs
- ./logs:/app/logs
- ./data:/app/data
volumes:
# postgres_data:
# redis_data:
minio_data:
livekit_redis_data:
livekit_pg_data: