-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (67 loc) · 2.75 KB
/
docker-compose.yml
File metadata and controls
78 lines (67 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: "3.8"
services:
sipstack-connector:
build: .
container_name: sipstack-connector
restart: unless-stopped
# REQUIRED: Host network mode for database access
# This allows the container to connect to localhost databases
network_mode: host
# Proper signal handling
stop_signal: SIGTERM
stop_grace_period: 30s
# Run as specific user (set PUID:PGID in .env to match your asterisk user)
# Run 'id asterisk' to get these values
user: "${PUID:-1000}:${PGID:-1000}"
environment:
# Required Configuration
API_KEY: ${API_KEY} # Your SIPSTACK API key (sk_{32 random characters})
AMI_HOST: ${AMI_HOST} # Asterisk server hostname/IP
AMI_PORT: ${AMI_PORT:-5038} # AMI port (default: 5038)
AMI_USERNAME: ${AMI_USERNAME} # AMI username
AMI_PASSWORD: ${AMI_PASSWORD} # AMI password
REGION: ${REGION:-us1} # API region (ca1, us1, us2)
# Optional Configuration
LOG_LEVEL: ${LOG_LEVEL:-INFO}
CDR_MODE: ${CDR_MODE:-batch}
CDR_BATCH_SIZE: ${CDR_BATCH_SIZE:-200}
CDR_BATCH_TIMEOUT: ${CDR_BATCH_TIMEOUT:-30}
# Monitoring
MONITORING_ENABLED: ${MONITORING_ENABLED:-true}
MONITORING_PORT: ${MONITORING_PORT:-8000}
# Recording Upload Configuration
RECORDING_CHECK_INTERVAL_SECONDS: ${RECORDING_CHECK_INTERVAL_SECONDS:-20}
RECORDING_UPLOAD_RETRY_MINUTES: ${RECORDING_UPLOAD_RETRY_MINUTES:-5}
RECORDING_WATCH_PATHS: ${RECORDING_WATCH_PATHS:-/var/spool/asterisk/monitor}
# Volume bindings for Asterisk recordings
volumes:
# Mount Asterisk spool directory for recording access (read-only)
- /var/spool/asterisk:/var/spool/asterisk:ro
# Note: Using host networking - metrics available on host port 8000
# Health check
healthcheck:
test: ["CMD", "python", "-c", "import socket; socket.create_connection(('localhost', 8000), timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Resource limits (optional)
deploy:
resources:
limits:
cpus: "1.0"
memory: 1G
reservations:
cpus: "0.2"
memory: 256M
# Optional: External network if Asterisk is in Docker
# networks:
# default:
# external:
# name: asterisk-network