56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: freeswitch-esl
|
|
|
|
services:
|
|
freeswitch1:
|
|
image: safarov/freeswitch:latest
|
|
container_name: fs1
|
|
volumes:
|
|
- ./etc-fs:/etc/freeswitch
|
|
ports: ["8021:8021"]
|
|
cap_add: [SYS_NICE]
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "fs_cli -H $(hostname -i) -P 8021 -p esl_mock_a95a037399153e9092b653fc -x status | grep -q '^UP'"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
networks: [fsnet]
|
|
|
|
# 第二个 FreeSWITCH 节点: 无共享状态, 出站外呼各自独立 (水平扩展验证)
|
|
freeswitch2:
|
|
image: safarov/freeswitch:latest
|
|
container_name: fs2
|
|
volumes:
|
|
- ./etc-fs:/etc/freeswitch
|
|
ports: ["8022:8021"]
|
|
cap_add: [SYS_NICE]
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "fs_cli -H $(hostname -i) -P 8021 -p esl_mock_a95a037399153e9092b653fc -x status | grep -q '^UP'"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
networks: [fsnet]
|
|
profiles: [scale]
|
|
|
|
# Mock SIP 运营商 (UAS): 应答 FreeSWITCH 的出站 INVITE
|
|
mock-provider:
|
|
image: python:3.12-alpine
|
|
container_name: fs-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: [fsnet]
|
|
|
|
networks:
|
|
fsnet:
|
|
driver: bridge
|