-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
157 lines (150 loc) · 4.19 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
version: "3.9"
services:
db:
image: public.ecr.aws/docker/library/postgres:alpine
volumes:
- ./tmp/db:/var/lib/postgresql/data
- ./docker/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: public.ecr.aws/docker/library/redis:alpine
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 10s
timeout: 5s
retries: 5
somleng: &somleng
image: ghcr.io/somleng/somleng
environment: &somleng_environment
RAILS_ENV: development
DATABASE_HOST: db
DASHBOARD_URL_HOST: "http://dashboard.lvh.me:3000"
SWITCH_HOST: "http://somleng-switch:8080"
DB_POOL: 30
REDIS_URL: redis://redis:6379/0
ANYCABLE_SECRET: secret
ANYCABLE_BROADCAST_ADAPTER: redisx
ports:
- "3000:3000"
depends_on: &somleng_depends_on
db:
condition: service_healthy
somleng-switch:
condition: service_healthy
networks:
default:
aliases:
- api.somleng.dev
healthcheck:
test: ["CMD-SHELL", "wget --server-response --spider --quiet http://0.0.0.0:3000/health_checks 2>&1 | grep '200 OK' > /dev/null"]
interval: 10s
timeout: 5s
retries: 10
command:
- "./bin/rails"
- "server"
- "-b"
- "0.0.0.0"
ws:
image: anycable/anycable-go:latest-alpine
ports:
- '8080:8080'
environment:
REDIS_URL: redis://redis:6379/0
ANYCABLE_HOST: "0.0.0.0"
ANYCABLE_PORT: "8080"
ANYCABLE_DISABLE_TELEMETRY: "true"
ANYCABLE_RPC_HOST: anycable:50051
ANYCABLE_BROADCAST_ADAPTER: redisx
ANYCABLE_BROKER: memory
ANYCABLE_PUBSUB: redis
ANYCABLE_HEADERS: x-device-key
ANYCABLE_DEBUG: 1
ANYCABLE_SECRET: secret
ANYCABLE_HEALTH_PATH: "/health"
ANYCABLE_LOG_LEVEL: "debug"
ANYCABLE_LOG_FORMAT: "json"
depends_on:
redis:
condition: service_healthy
anycable:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --server-response --spider --quiet http://0.0.0.0:8080/health 2>&1 | grep '200 OK' > /dev/null"]
interval: 10s
timeout: 5s
retries: 10
anycable:
<<: *somleng
command: bundle exec anycable
environment:
<<: *somleng_environment
ANYCABLE_RPC_HOST: 0.0.0.0:50051
ANYCABLE_DEBUG: 1
ports:
- '50051'
depends_on:
<<: *somleng_depends_on
healthcheck:
test: ["CMD-SHELL", "grpc-health-probe -addr :50051"]
interval: 10s
timeout: 5s
retries: 10
somleng-switch:
image: ghcr.io/somleng/switch-app
environment:
AHN_CORE_HOST: freeswitch
AHN_CORE_HTTP_PORT: 8080
CALL_PLATFORM_HOST: "http://api.somleng.dev:3000"
REDIS_URL: "redis://redis:6379/1"
depends_on:
redis:
condition: service_healthy
freeswitch:
condition: service_healthy
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
freeswitch:
image: ghcr.io/somleng/freeswitch
platform: linux/amd64
environment:
- FS_DATABASE_HOST=db
- FS_MOD_JSON_CDR_URL=http://api.somleng.dev:3000/services/call_data_records
- FS_EXTERNAL_SIP_IP
- FS_EXTERNAL_RTP_IP
ports:
- "5060:5060/udp"
depends_on:
- db
healthcheck:
test: ["CMD-SHELL", "nc -z -w 5 localhost 5222"]
interval: 10s
timeout: 5s
retries: 10
sms-gateway:
image: ghcr.io/somleng/sms-gateway
ports:
- "3210:3210"
environment:
DEVICE_TOKEN: change-me
command: somleng-sms-gateway -v -k $DEVICE_TOKEN -d ws://ws:8080 dummy
depends_on:
ws:
condition: service_healthy
profiles:
- donotstart
healthcheck:
test: ["CMD-SHELL", "wget --server-response --spider --quiet http://localhost:3210 2>&1 | grep '200 OK' > /dev/null"]
interval: 10s
timeout: 5s
retries: 10