-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
154 lines (144 loc) · 4.52 KB
/
docker-compose.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: '3'
services:
asterisk:
image: andrius/asterisk:alpine_glibc-18.x
volumes:
- tele_conf_base:/etc/asterisk/ # Persistent storage
- tele_spool_base:/var/spool/asterisk/
- /etc/localtime:/etc/localtime:ro # Use host timezone
ports:
- "5060:5060/udp"
- "5061:5061/tcp"
- "10000-10009:10000-10009/udp"
deploy:
mode: replicated
replicas: 1
networks:
local:
aliases:
- asterisk.local
asterisk1:
image: fgst/asterisk:full
cap_add:
- sys_ptrace # Only here to help testing
- net_admin # Allow NFT, used by AutoBan
- net_raw # Allow NFT, used by AutoBan
environment:
- SYSLOG_LEVEL=${SYSLOG_LEVEL-4} # Logging
- HOSTNAME=${TELE_SRV-tele}.${DOMAIN-docker.localhost}
- PULSE_SERVER=unix:/run/pulse/socket # Use host audio
- PULSE_COOKIE=/run/pulse/cookie # Use host audio
- WEBSMSD_PORT=${WEBSMSD_PORT-80} # WEBSMSD internal port
volumes:
- tele_conf1:/srv # Persistent storage
- ./pulse1:/run/pulse:rshared # Use host audio
- /etc/localtime:/etc/localtime:ro # Use host timezone
ports:
- "10000-10009:10000-10009/udp"
deploy:
mode: replicated
replicas: 1
networks:
local:
aliases:
- asterisk1.local
asterisk2:
image: fgst/asterisk:base
cap_add:
- sys_ptrace # Only here to help testing
- net_admin # Allow NFT, used by AutoBan
- net_raw # Allow NFT, used by AutoBan
environment:
- SYSLOG_LEVEL=${SYSLOG_LEVEL-4} # Logging
- HOSTNAME=${TELE_SRV-tele}.${DOMAIN-docker.localhost}
- PULSE_SERVER=unix:/run/pulse/socket # Use host audio
- PULSE_COOKIE=/run/pulse/cookie # Use host audio
- WEBSMSD_PORT=${WEBSMSD_PORT-80} # WEBSMSD internal port
volumes:
- tele_conf2:/srv # Persistent storage
- ./pulse2:/run/pulse:rshared # Use host audio
- /etc/localtime:/etc/localtime:ro # Use host timezone
ports:
- "10010-10019:10010-10019/udp"
deploy:
mode: replicated
replicas: 1
networks:
local:
aliases:
- asterisk2.local
asterisk3:
image: fgst/asterisk:base
cap_add:
- sys_ptrace # Only here to help testing
- net_admin # Allow NFT, used by AutoBan
- net_raw # Allow NFT, used by AutoBan
environment:
- SYSLOG_LEVEL=${SYSLOG_LEVEL-4} # Logging
- HOSTNAME=${TELE_SRV-tele}.${DOMAIN-docker.localhost}
- PULSE_SERVER=unix:/run/pulse/socket # Use host audio
- PULSE_COOKIE=/run/pulse/cookie # Use host audio
- WEBSMSD_PORT=${WEBSMSD_PORT-80} # WEBSMSD internal port
volumes:
- tele_conf3:/srv # Persistent storage
- ./pulse3:/run/pulse:rshared # Use host audio
- /etc/localtime:/etc/localtime:ro # Use host timezone
ports:
- "10020-10029:10020-10029/udp"
deploy:
mode: replicated
replicas: 1
networks:
local:
aliases:
- asterisk3.local
kamailio_dispatcher:
depends_on:
- db
- asterisk1
- asterisk2
- asterisk3
build:
context: ${PWD}/kamailio
dockerfile: Dockerfile
volumes:
- dispatcher_conf:/etc/kamailio/
ports:
- "5060:5060/udp"
- "5060:5060/tcp"
restart: always
networks:
local:
aliases:
- kamailio_dispatcher.local
db:
image: mysql:5.7
volumes:
- /tmp/dbdata:/var/lib/mysql
- ./containers/mysql/resources:/docker-entrypoint-initdb.d/
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_USER=kamailio
- MYSQL_PASSWORD=kamailiorw
- MYSQL_DATABASE=kamailio
ports:
- "3306"
healthcheck:
test: mysql --user=root -e "select * from mysql.user"
timeout: 45s
retries: 5
networks:
local:
aliases:
- db.local
networks:
local:
volumes:
dispatcher_conf:
asterisk_conf:
asterisk_spool:
tele_conf_base:
tele_spool_base:
tele_conf1:
tele_conf2:
tele_conf3: