-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
204 lines (192 loc) · 5.44 KB
/
docker-compose.yml
File metadata and controls
204 lines (192 loc) · 5.44 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
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
196
197
198
199
200
201
202
203
204
services:
postgres:
platform: linux/amd64
image: postgres:15-alpine
container_name: rapida__postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: rapida_user
POSTGRES_PASSWORD: rapida_db_password
POSTGRES_DB: web_db
volumes:
- ${HOME}/rapida-data/assets/db:/var/lib/postgresql/data
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- api-network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U rapida_user -d web_db && pg_isready -U rapida_user -d assistant_db && pg_isready -U rapida_user -d integration_db && pg_isready -U rapida_user -d endpoint_db" ]
interval: 3s
timeout: 5s
retries: 5
start_period: 5s
# Redis Cache
redis:
platform: linux/amd64
image: redis:7-alpine
container_name: rapida__redis
ports:
- "6379:6379"
volumes:
- ${HOME}/rapida-data/assets/redis:/data
networks:
- api-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 3s
timeout: 3s
retries: 5
start_period: 3s
nginx:
platform: linux/amd64
image: nginx:alpine
container_name: rapida__nginx
ports:
- "8080:8080"
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ui_build:/usr/share/nginx/html:ro
- ./docker/nginx/ssl:/etc/nginx/ssl:ro
- ${HOME}/rapida-data/assets:/app/rapida-data/assets
depends_on:
- web-api
- assistant-api
- integration-api
- endpoint-api
- ui
networks:
- api-network
ui:
platform: linux/amd64
build:
context: .
dockerfile: docker/ui/Dockerfile
args:
EDITION: local
container_name: rapida__ui
ports:
- "3000:3000"
networks:
- api-network
# Web API Service
web-api:
platform: linux/amd64
build:
context: .
dockerfile: docker/web-api/Dockerfile
container_name: rapida__web-api
ports:
- "9001:9001"
environment:
ENV_PATH: /opt/apps/env/web.yml
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./docker/web-api/web.yml:/opt/apps/env/web.yml:ro
- ${HOME}/rapida-data/assets:/app/rapida-data/assets
- go-mod-cache:/go/pkg/mod
networks:
- api-network
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--method=GET", "-O", "/dev/null", "http://localhost:9001/readiness/" ]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
# Assistant API Service
assistant-api:
platform: linux/amd64
build:
context: .
dockerfile: docker/assistant-api/Dockerfile
container_name: rapida__assistant-api
ports:
- "9007:9007" # WebSocket and REST API
- "4573:4573" # AudioSocket for Asterisk integration
- "5090:5090/udp" # SIP signaling
- "10000-10199:10000-10199/udp" # RTP media (100 concurrent calls)
- "20000-20100:20000-20100/udp" # WebRTC ICE/media
environment:
ENV_PATH: /opt/apps/env/assistant.yml
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./docker/assistant-api/assistant.yml:/opt/apps/env/assistant.yml:ro
- ${HOME}/rapida-data/assets:/app/rapida-data/assets
- go-mod-cache:/go/pkg/mod
networks:
- api-network
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--method=GET", "-O", "/dev/null", "http://localhost:9007/readiness/" ]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
# Integration API Service
integration-api:
platform: linux/amd64
build:
context: .
dockerfile: docker/integration-api/Dockerfile
container_name: rapida__integration-api
ports:
- "9004:9004"
environment:
ENV_PATH: /opt/apps/env/integration.yml
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./docker/integration-api/integration.yml:/opt/apps/env/integration.yml:ro
- ${HOME}/rapida-data/assets:/app/rapida-data/assets
- go-mod-cache:/go/pkg/mod
networks:
- api-network
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--method=GET", "-O", "/dev/null", "http://localhost:9004/readiness/" ]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
# Endpoint API Service
endpoint-api:
platform: linux/amd64
build:
context: .
dockerfile: docker/endpoint-api/Dockerfile
container_name: rapida__endpoint-api
ports:
- "9005:9005"
environment:
ENV_PATH: /opt/apps/env/endpoint.yml
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./docker/endpoint-api/endpoint.yml:/opt/apps/env/endpoint.yml:ro
- ${HOME}/rapida-data/assets:/app/rapida-data/assets
- go-mod-cache:/go/pkg/mod
networks:
- api-network
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--method=GET", "-O", "/dev/null", "http://localhost:9005/readiness/" ]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
networks:
api-network:
driver: bridge
volumes:
go-mod-cache:
ui_build: