-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yaml
More file actions
319 lines (297 loc) · 9.01 KB
/
Copy pathdocker-compose.test.yaml
File metadata and controls
319 lines (297 loc) · 9.01 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
services:
# Test runner service
api-test:
container_name: adsb_api_test
build:
context: ./adsb-api
dockerfile: Dockerfile.test
profiles: ["test"]
environment:
# Database: Point to pgbouncer instead of postgres
- DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@pgbouncer:5432/${POSTGRES_DB}
- REDIS_URL=${REDIS_URL}
# ADS-B Sources
- ULTRAFEEDER_HOST=${ULTRAFEEDER_HOST:-ultrafeeder}
- ULTRAFEEDER_PORT=${ULTRAFEEDER_PORT:-80}
- DUMP978_HOST=${DUMP978_HOST:-dump978}
- DUMP978_PORT=${DUMP978_PORT:-80}
# Feeder Location
- FEEDER_LAT=${FEEDER_LAT}
- FEEDER_LON=${FEEDER_LON}
# Notifications
- APPRISE_URLS=${APPRISE_URLS}
- NOTIFICATION_COOLDOWN=${NOTIFICATION_COOLDOWN}
# Safety Monitoring
- SAFETY_MONITORING_ENABLED=true
- SAFETY_PROXIMITY_NM=1.0
- SAFETY_ALTITUDE_DIFF_FT=1000
# Python
- PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
- PYTHONUNBUFFERED=${PYTHONUNBUFFERED}
volumes:
- ./test-results:/app/test-results
depends_on:
pgbouncer: # Changed dependency to pgbouncer
condition: service_healthy
redis:
condition: service_healthy
ultrafeeder:
condition: service_healthy
dump978:
condition: service_healthy
networks:
- test-network
api:
container_name: adsb_api_dev
build:
context: .
dockerfile: Dockerfile
profiles: ["dev"]
environment:
# Database: Point to pgbouncer instead of postgres
- DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@pgbouncer:5432/${POSTGRES_DB}
- REDIS_URL=${REDIS_URL}
- ULTRAFEEDER_HOST=${ULTRAFEEDER_HOST:-ultrafeeder}
- ULTRAFEEDER_PORT=${ULTRAFEEDER_PORT:-80}
- DUMP978_HOST=${DUMP978_HOST:-dump978}
- DUMP978_PORT=${DUMP978_PORT:-80}
- FEEDER_LAT=${FEEDER_LAT}
- FEEDER_LON=${FEEDER_LON}
- APPRISE_URLS=${APPRISE_URLS}
- POLLING_INTERVAL=${POLLING_INTERVAL}
- DB_STORE_INTERVAL=${DB_STORE_INTERVAL}
- NOTIFICATION_COOLDOWN=${NOTIFICATION_COOLDOWN}
- PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE}
- PYTHONUNBUFFERED=${PYTHONUNBUFFERED}
- PORT=${PORT}
# ACARS settings
- ACARS_ENABLED=${ACARS_ENABLED}
- ACARS_PORT=${ACARS_PORT}
- VDLM2_PORT=${VDLM2_PORT}
# Open SKY DB
- OPENSKY_DB_ENABLED=${OPENSKY_DB_ENABLED}
- OPENSKY_DB_PATH=${OPENSKY_DB_PATH}
# Photo Cache
- PHOTO_CACHE_ENABLED=${PHOTO_CACHE_ENABLED:-true}
- PHOTO_CACHE_DIR=${PHOTO_CACHE_DIR:-/data/photos}
- S3_ENABLED=${S3_ENABLED:-false}
- S3_BUCKET=${S3_BUCKET}
- S3_REGION=${S3_REGION:-us-west-1}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_ENDPOINT_URL=${S3_ENDPOINT_URL}
- S3_PREFIX=${S3_PREFIX:-airfame-cache}
- S3_PUBLIC_URL=${S3_PUBLIC_URL}
# Sentry
- SENTRY_DSN=${SENTRY_DSN:-}
- SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT:-local-dev}
volumes:
- ./test/api-cache:/data
ports:
- "${API_PORT}:5000"
depends_on:
pgbouncer: # Changed dependency to pgbouncer
condition: service_healthy
redis:
condition: service_healthy
ultrafeeder:
condition: service_healthy
dump978:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/v1/health"]
interval: 10s
timeout: 5s
retries: 3
networks:
- test-network
# --- NEW SERVICE: PgBouncer ---
pgbouncer:
image: edoburu/pgbouncer:latest
profiles: ["dev","test"]
container_name: adsb_pgbouncer
environment:
- DB_USER=${POSTGRES_USER}
- DB_PASSWORD=${POSTGRES_PASSWORD}
- DB_HOST=postgres
- DB_NAME=${POSTGRES_DB}
# Transaction pooling is best for modern async apps
- POOL_MODE=transaction
- MAX_CLIENT_CONN=1000
- DEFAULT_POOL_SIZE=20
- AUTH_TYPE=plain
- ADMIN_USERS=${POSTGRES_USER}
ports:
- "5432" # Internal port exposure
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "pg_isready", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 5
networks:
- test-network
adsb-dashboard:
build:
context: ./web
dockerfile: Dockerfile.dev
container_name: adsb-dashboard-dev
working_dir: /app
profiles: ["dev"]
ports:
- "${DASHBOARD_PORT}:3000"
volumes:
- ./web/src:/app/src
- ./web/public:/app/public
- ./web/index.html:/app/index.html
environment:
- NODE_ENV=${NODE_ENV}
stdin_open: true
tty: true
# PostgreSQL for integration tests
postgres:
image: postgres:16-alpine
profiles: ["dev","test"]
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U adsb -d adsb_test"]
interval: 5s
timeout: 5s
retries: 5
tmpfs:
- /var/lib/postgresql/data
networks:
- test-network
# Redis for SSE pub/sub across workers
redis:
image: redis:7-alpine
profiles: ["dev","test"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
tmpfs:
- /data
networks:
- test-network
# Mock ultrafeeder service for integration tests
ultrafeeder:
build:
context: ./test/mock-1090
dockerfile: Dockerfile
image: ghcr.io/cha0s-corp/1090-mock:latest
profiles: ["dev","test"]
command: ["python3", "mock_1090.py"]
environment:
- MOCK_TYPE=ultrafeeder
- ADSBX_API_KEY=${ADSBX_API_KEY}
networks:
- test-network
ports:
- ${ULTRAFEEDER_PORT_EXTERNAL}:80
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 10s
timeout: 5s
retries: 3
# Mock dump978 service for integration tests
dump978:
build:
context: ./test/mock-1090
dockerfile: Dockerfile
image: ghcr.io/cha0s-corp/1090-mock:latest
profiles: ["dev","test"]
command: ["python3", "mock_1090.py"]
environment:
- MOCK_TYPE=dump978
- ADSBX_API_KEY=${ADSBX_API_KEY}
networks:
- test-network
ports:
- ${DUMP978_PORT_EXTERNAL}:80
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
interval: 10s
timeout: 5s
retries: 3
acarshub-mock:
build:
context: ./test/acars-mock/
dockerfile: Dockerfile
image: ghcr.io/cha0s-corp/acarshub-mock:latest
profiles: ["dev","test"]
container_name: acarshub-mock
restart: unless-stopped
networks:
- test-network
ports:
# Web interface
- "${ACARSHUB_WEB_PORT}:8080"
# UDP ports (same as real ACARSHUB - for receiving from decoders)
- "${ACARS_UDP_PORT}:5550/udp" # ACARS (acarsdec)
- "${VDLM2_UDP_PORT}:5555/udp" # VDLM2 (dumpvdl2)
- "${HFDL_UDP_PORT}:5556/udp" # HFDL (dumphfdl)
- "${IMSL_UDP_PORT}:5557/udp" # IMSL (Inmarsat)
- "${IRDM_UDP_PORT}:5558/udp" # IRDM (Iridium)
# TCP relay ports (for consuming messages)
- "${ACARS_TCP_PORT}:15550" # ACARS TCP relay
- "${VDLM2_TCP_PORT}:15555" # VDLM2 TCP relay
- "${HFDL_TCP_PORT}:15556" # HFDL TCP relay
- "${IMSL_TCP_PORT}:15557" # IMSL TCP relay
- "${IRDM_TCP_PORT}:15558" # IRDM TCP relay
environment:
# Mock message generation
- MOCK_ENABLED=${MOCK_ENABLED}
- MOCK_INTERVAL_MIN=${MOCK_INTERVAL_MIN}
- MOCK_INTERVAL_MAX=${MOCK_INTERVAL_MAX}
# Station identification
- STATION_ID=${STATION_ID}
# Relay configuration - set these to send messages to your service
# Uncomment and configure:
- RELAY_HOST=${RELAY_HOST}
- RELAY_PORT=${RELAY_PORT}
- RELAY_PROTOCOL=${RELAY_PROTOCOL}
# Optional: healthcheck
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/stats"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
# Mock airband transmission uploader for testing audio pipeline
mock-airband-uploader:
build:
context: ./test/mock-airband-uploader
dockerfile: Dockerfile
image: ghcr.io/cha0s-corp/rtl-airband-mock:latest
profiles: ["dev"]
container_name: mock-airband-uploader
environment:
- SKYSPY_API_URL=http://api:5000
- METRICS_PORT=9091
- MIN_TRANSMISSION_INTERVAL=5
- MAX_TRANSMISSION_INTERVAL=30
ports:
- "9091:9091"
depends_on:
api:
condition: service_healthy
networks:
- test-network
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:9091/metrics', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
test-network:
driver: bridge
volumes:
node_modules: