-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
172 lines (162 loc) · 4.49 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# This docker-compose configuration is intended to be used for integration testing only.
#
# Note:
# Assumes postgres is running on the host machine.
# Postgres is not included in this docker compose configuration
# because of the complexity of adding code to wait for postgres to start.
volumes:
workspace:
opensips_fifo:
services:
redis:
image: public.ecr.aws/docker/library/redis:alpine
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
gateway-bootstrap:
build:
context: components/gateway
target: bootstrap
image: gateway:bootstrap
platform: linux/amd64
environment:
DATABASE_USERNAME: "postgres"
DATABASE_PASSWORD:
DATABASE_NAME:
DATABASE_HOST: "host.docker.internal"
DATABASE_PORT: 5432
extra_hosts:
- "host.docker.internal:host-gateway"
public_gateway:
build:
context: components/gateway
target: public_gateway
image: public_gateway:latest
platform: linux/amd64
environment:
DATABASE_URL: "postgres://postgres:@host.docker.internal:5432/opensips_public_gateway_test"
FIFO_NAME: /opensips/fifo/public_gateway
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD-SHELL", "nc -z -w 5 $$(hostname -i) 5060"]
interval: 10s
timeout: 5s
retries: 10
expose:
- "5060/udp"
- "5080/udp"
volumes:
- opensips_fifo:/opensips/fifo
client_gateway:
build:
context: components/gateway
target: client_gateway
image: client_gateway:latest
platform: linux/amd64
environment:
DATABASE_URL: "postgres://postgres:@host.docker.internal:5432/opensips_client_gateway_test"
FIFO_NAME: /opensips/fifo/client_gateway
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD-SHELL", "nc -z -w 5 $$(hostname -i) 5060"]
interval: 10s
timeout: 5s
retries: 10
expose:
- "5060/udp"
volumes:
- opensips_fifo:/opensips/fifo
media_proxy:
build:
context: components/media_proxy
image: media_proxy:latest
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD-SHELL", "nc -z -w 5 $$(hostname -i) 2224"]
interval: 10s
timeout: 5s
retries: 10
expose:
- "2223/udp"
freeswitch:
build:
context: components/freeswitch
image: freeswitch:latest
platform: linux/amd64
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
FS_ALTERNATIVE_RTP_IP: "18.141.245.230"
FS_EVENT_SOCKET_PASSWORD: secret
FS_EVENT_SOCKET_PORT: 8021
expose:
- "5060/udp"
- "5222/tcp"
- "5080/udp"
- "8021/tcp"
healthcheck:
test:
["CMD-SHELL", "fs_cli -p secret -x 'rayo status' | rayo_status_parser"]
interval: 10s
timeout: 5s
retries: 10
freeswitch_event_logger:
build:
context: components/freeswitch_event_logger
image: freeswitch_event_logger:latest
depends_on:
redis:
condition: service_healthy
freeswitch:
condition: service_healthy
environment:
EVENT_SOCKET_HOST: freeswitch:8021
EVENT_SOCKET_PASSWORD: secret
REDIS_URL: "redis://redis:6379/1"
switch-app:
build:
context: components/app
image: switch-app:latest
depends_on:
redis:
condition: service_healthy
environment:
AHN_CORE_HOST: freeswitch
CALL_PLATFORM_STUB_RESPONSES: "true"
CONNECT_WS_SERVER_URL: "ws://testing:3001"
AUDIO_FILE_URL: "http://testing:8000/scenarios/files/tone.wav"
AHN_CORE_HTTP_PORT: "8080"
AWS_DEFAULT_REGION: "ap-southeast-1"
REDIS_URL: "redis://redis:6379/1"
healthcheck:
test:
[
"CMD-SHELL",
"wget --server-response --spider --quiet http://0.0.0.0:8080/health_checks 2>&1 | grep '200 OK' > /dev/null",
]
interval: 10s
timeout: 5s
retries: 10
expose:
- "8080/tcp"
testing:
build:
context: components/testing
image: testing:latest
environment:
DATABASE_HOST: host.docker.internal
DATABASE_PORT: 5432
DATABASE_USERNAME: postgres
FIFO_DIR: /opensips/fifo
WS_SERVER_PORT: 3001
FILE_SERVER_PORT: 8000
SWITCH_PORT: 8080
FILE_SERVER_LOG_FILE: http-server.log
UAS: "true"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- workspace:/workspace
- opensips_fifo:/opensips/fifo