chore: init SIP research repo (Asterisk & LiveKit)
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
name: livekit-sip
|
||||
|
||||
services:
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: lk-redis
|
||||
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru --save "" --appendonly no
|
||||
restart: unless-stopped
|
||||
networks: [lksip]
|
||||
|
||||
livekit:
|
||||
image: livekit/livekit-server:latest
|
||||
container_name: lk-livekit
|
||||
command: --config /etc/livekit.yaml
|
||||
volumes:
|
||||
- ./conf/livekit.yaml:/etc/livekit.yaml:ro
|
||||
ports: ["7880:7880"]
|
||||
restart: unless-stopped
|
||||
networks: [lksip]
|
||||
depends_on: [redis]
|
||||
|
||||
# 第二个 LiveKit 节点: 同一 Redis 即自动组成多节点集群(水平扩展验证)
|
||||
livekit2:
|
||||
image: livekit/livekit-server:latest
|
||||
container_name: lk-livekit2
|
||||
command: --config /etc/livekit.yaml
|
||||
volumes:
|
||||
- ./conf/livekit.yaml:/etc/livekit.yaml:ro
|
||||
ports: ["7883:7880"]
|
||||
restart: unless-stopped
|
||||
networks: [lksip]
|
||||
depends_on: [redis]
|
||||
profiles: [multinode]
|
||||
|
||||
# SIP 网关 x2: 无状态, 经 Redis 被随机调度, 天然水平扩展
|
||||
sip1:
|
||||
image: livekit/sip:latest
|
||||
container_name: lk-sip1
|
||||
command: --config /etc/sip.yaml
|
||||
volumes:
|
||||
- ./conf/sip.yaml:/etc/sip.yaml:ro
|
||||
ports: ["8081:8081", "9091:9091"]
|
||||
restart: unless-stopped
|
||||
networks: [lksip]
|
||||
depends_on: [redis, livekit]
|
||||
|
||||
sip2:
|
||||
image: livekit/sip:latest
|
||||
container_name: lk-sip2
|
||||
command: --config /etc/sip.yaml
|
||||
volumes:
|
||||
- ./conf/sip.yaml:/etc/sip.yaml:ro
|
||||
ports: ["8082:8081", "9092:9091"]
|
||||
restart: unless-stopped
|
||||
networks: [lksip]
|
||||
depends_on: [redis, livekit]
|
||||
|
||||
# Mock SIP 运营商 (UAS): 应答 livekit-sip 的出站 INVITE
|
||||
mock-provider:
|
||||
image: python:3.12-alpine
|
||||
container_name: lk-mock-provider
|
||||
working_dir: /app
|
||||
command: python mock/mock-provider.py
|
||||
volumes:
|
||||
- ./mock:/app/mock:ro
|
||||
environment:
|
||||
SIP_PORT: "5060"
|
||||
RTP_PORT: "40000"
|
||||
RING_DELAY: "1.5"
|
||||
restart: unless-stopped
|
||||
networks: [lksip]
|
||||
|
||||
networks:
|
||||
lksip:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user