This repository was archived by the owner on Jul 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.swarm.yml
More file actions
230 lines (218 loc) · 5.46 KB
/
Copy pathdocker-compose.swarm.yml
File metadata and controls
230 lines (218 loc) · 5.46 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
x-server-common: &server-common
image: btsearch-server:${COMMIT_SHA}
environment:
# Database
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=redis://default:${REDIS_PASSWORD}@redis:6379
# Authentication
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
- BASE_URL=${BASE_URL}
# App configuration
- APP_NAME=${APP_NAME:-OpenBTS}
- WORKERS=1
# Resend (email)
- RESEND_API_KEY=${RESEND_API_KEY}
- RESEND_FROM=${RESEND_FROM:-noreply@openbts.sakilabs.com}
# AXIOM HQ logging
- AXIOM_TOKEN=${AXIOM_TOKEN}
- AXIOM_DATASET=${AXIOM_DATASET:-openbts}
- NTM_USERAGENT=${NTM_USERAGENT}
# VAPID push notifications (fill in after running: web-push generate-vapid-keys --json):
- VAPID_SUBJECT=${VAPID_SUBJECT}
- VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY}
- VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY}
- KMZ_OUTPUT_DIR=/app/kmz
volumes:
- uploads-volume:/app/uploads
- type: bind
source: /opt/openbts/kmz
target: /app/kmz
networks:
- internal
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3031/api/v1/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
deploy:
replicas: 1
update_config:
parallelism: 1
order: stop-first
failure_action: rollback
delay: 0s
rollback_config:
parallelism: 1
order: stop-first
failure_action: pause
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
placement:
constraints:
- node.role == manager
services:
migrate:
image: btsearch-server:${COMMIT_SHA}
command: ["./docker-migrate.sh"]
environment:
- DATABASE_URL=${DATABASE_URL}
networks:
- internal
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
placement:
constraints:
- node.role == manager
server:
<<: *server-common
ports:
- target: 3031
published: 3031
mode: host
server-2:
<<: *server-common
ports:
- target: 3031
published: 3032
mode: host
server-3:
<<: *server-common
ports:
- target: 3031
published: 3033
mode: host
server-4:
<<: *server-common
ports:
- target: 3031
published: 3034
mode: host
discord-bot:
image: btsearch-discord-bot:${COMMIT_SHA}
environment:
- DISCORD_TOKEN=${DISCORD_BOT_TOKEN}
- DISCORD_IMPORT_CHANNEL_ID=${DISCORD_BOT_IMPORT_CHANNEL_ID}
- DISCORD_GUILD_ID=${DISCORD_BOT_GUILD_ID}
- REDIS_URL=redis://default:${REDIS_PASSWORD}@redis:6379
- API_KEY=${DISCORD_BOT_API_KEY}
- API_BASE_URL=${DISCORD_BOT_API_BASE_URL}
- PUBLIC_BASE_URL=${DISCORD_BOT_PUBLIC_BASE_URL}
networks:
- internal
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
client:
image: btsearch-client:${COMMIT_SHA}
ports:
- target: 80
published: 3000
mode: host
networks:
- internal
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:80"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
deploy:
replicas: 1
update_config:
order: stop-first
failure_action: rollback
restart_policy:
condition: on-failure
postgres:
image: openbts-postgres
environment:
- POSTGRES_USER=${POSTGRES_USER:-user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_DB=${POSTGRES_DB:-openbts}
volumes:
- postgres-volume:/var/lib/postgresql/18/docker
- type: tmpfs
target: /dev/shm
tmpfs:
size: 4294967296
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-user} -d ${POSTGRES_DB:-openbts}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
pgbouncer:
image: dhi.io/pgbouncer:1.25
depends_on:
- postgres
ports:
- target: 6432
published: 6432
mode: host
volumes:
- ./docker/pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro
- ./docker/pgbouncer/userlist.txt:/etc/pgbouncer/userlist.txt:ro
networks:
- internal
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
redis:
image: redis:alpine
command: redis-server --save 60 1 --appendonly yes --requirepass ${REDIS_PASSWORD}
ports:
- target: 6379
published: 6379
mode: host
volumes:
- redis-volume:/data
networks:
- internal
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
networks:
internal:
driver: overlay
attachable: true
volumes:
postgres-volume:
external: true
name: btsearch_postgres-volume
uploads-volume:
external: true
name: btsearch_uploads-volume
redis-volume:
external: true
name: btsearch_redis-volume