forked from keithcroxford/kamailio-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
195 lines (183 loc) · 4.44 KB
/
docker-compose.yaml
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
---
version: "3.9"
services:
sngrep:
build:
context: ./sngrep
dockerfile: Dockerfile
container_name: sngrep
privileged: true
network_mode: host
environment:
- TERM=xterm
cap_add:
- NET_ADMIN
kamailio-edge:
image: kamailio/kamailio-ci:5.4-alpine.debug
container_name: kamailio-edge
ports:
- "5090:5060"
volumes:
- ./kamailio-default/etc/kamailio/:/etc/kamailio
- ./kamailio-default/etc/resolv.conf:/etc/resolv.conf
environment:
- KAM_SHM_MEM_SIZE=256
- COREIP=172.16.254.2
- CORESUBNET=172.16.254.1/24
- TLSPORT=5061
- UDPPORT=5060
- PUBLICIP=192.168.254.2
- DBUSERNAME=kamailio
- DBPASSWORD=kamailiorw
- DBHOST=172.16.254.10
- DBNAME=kamailio
depends_on:
rtpengine-edge:
condition: service_started
db:
condition: service_started
dns:
- 172.16.254.20
networks:
external:
ipv4_address: 192.168.254.2
internal:
ipv4_address: 172.16.254.2
rtpengine-edge:
build:
context: ./rtpengine-edge/docker
dockerfile: Dockerfile
container_name: rtpengine-edge
ports:
- "23000-23100:23000-23100"
volumes:
- ./rtpengine-edge/config:/etc/rtpengine
networks:
external:
ipv4_address: 192.168.254.3
internal:
ipv4_address: 172.16.254.3
b2bua_internal_01:
tty: true
container_name: b2bua_internal_01
stdin_open: true
volumes:
- ./b2bua/b2bua_internal_01/:/config
command: pjsua --config-file=/config/pjsua.cfg
image: andrius/pjsua:latest
ports:
- "5091:5060"
networks:
internal:
ipv4_address: 172.16.254.100
depends_on:
kamailio-edge:
condition: service_started
b2bua_internal_02:
tty: true
container_name: b2bua_internal_02
stdin_open: true
image: andrius/pjsua:latest
command: pjsua --null-audio --no-tcp --auto-answer=200 --outbound sip:172.16.254.2;lr
ports:
- "5092:5060"
networks:
internal:
ipv4_address: 172.16.254.101
depends_on:
kamailio-edge:
condition: service_started
b2bua_external_01:
tty: true
container_name: b2bua_external_01
stdin_open: true
volumes:
- ./b2bua/b2bua_external_01/:/config
image: andrius/pjsua:latest
command: pjsua --config-file=/config/pjsua.cfg
#command: "tail -f /dev/null"
ports:
- "5093:5060"
networks:
external:
ipv4_address: 192.168.254.100
depends_on:
kamailio-edge:
condition: service_started
b2bua_external_02:
tty: true
container_name: b2bua_external_02
stdin_open: true
volumes:
- ./b2bua/b2bua_external_02/:/config
image: andrius/pjsua:latest
command: pjsua --config-file=/config/pjsua.cfg
#command: "tail -f /dev/null"
ports:
- "5094:5060"
networks:
external:
ipv4_address: 192.168.254.101
depends_on:
kamailio-edge:
condition: service_started
db:
image: mysql:5.7
restart: always
container_name: db01
environment:
MYSQL_DATABASE: 'kamailio'
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'ro_password'
MYSQL_ROOT_PASSWORD: 'rw_password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- ./db:/var/lib/mysql
networks:
internal:
ipv4_address: 172.16.254.10
bind:
image: internetsystemsconsortium/bind9:9.20
container_name: bind
ports:
- "53:53/udp"
- "53:53/tcp"
volumes:
- ./bind/named.conf:/etc/bind/named.conf
- ./bind/named.conf.local:/etc/bind/named.conf.local
- ./bind/db.e164.arpa:/etc/bind/db.e164.arpa
restart: always
networks:
internal:
ipv4_address: 172.16.254.20
api:
container_name: api
build:
context: ./api/
dockerfile: docker/Dockerfile
environment:
- FLASK_RUN_HOST=0.0.0.0
- FLASK_RUN_PORT=5000
ports:
- "5000:5000"
volumes:
- ./api/app:/app
networks:
internal:
ipv4_address: 172.16.254.30
networks:
external:
# use the bridge driver, but enable IPv6
ipam:
config:
- subnet: 192.168.254.0/24
gateway: 192.168.254.1
internal:
# use a custom driver, with no options
ipam:
config:
- subnet: 172.16.254.0/24
gateway: 172.16.254.1