-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
656 lines (554 loc) · 23.1 KB
/
Dockerfile
File metadata and controls
656 lines (554 loc) · 23.1 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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# =============================================================================
# WaveKit Multi-Stage Dockerfile
#
# Architecture: Production-ready SDR stream processing framework with s6-overlay
# Process Management: Full process supervision with auto-restart & dependency handling
# Optimization: BuildKit-compatible, multi-platform (amd64/arm64), layer caching
#
# Deployment modes:
# - full: Everything (SDR++, WaveKit API, all decoders) - for single-host setups
# - core: Just API + decoders (SDR++ externalized) - for distributed setups
# - sdrpp: Just SDR++ server (IQ/audio provider) - for dedicated SDR host
#
# Usage:
# docker build -t wavekit:latest -f Dockerfile .
# docker run --rm -it wavekit:latest
# =============================================================================
# ============================================================================
# Stage: base-deps
# Purpose: Common system dependencies for all build stages
# Size: ~150MB (reduced with only-production install)
# ============================================================================
FROM debian:bookworm-slim AS base-deps
# Use buildkit cache for package lists
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends \
# Build toolchain
build-essential \
cmake \
git \
pkg-config \
# Audio & signal processing
libfftw3-dev \
libsndfile1-dev \
libopus-dev \
libopusfile-dev \
libvorbis-dev \
libogg-dev \
libflac-dev \
libavformat-dev \
libavcodec-dev \
libswresample-dev \
libpulse-dev \
# SDR libraries
librtlsdr-dev \
libhackrf-dev \
libairspy-dev \
libairspyhf-dev \
libbladerf-dev \
libsoapysdr-dev \
libusb-1.0-0-dev \
libudev-dev \
# dsd-fme dependencies
libitpp-dev \
# direwolf dependencies
libasound2-dev \
libgps-dev \
libhamlib-dev \
# dumpvdl2 dependencies
libglib2.0-dev \
libsqlite3-dev \
libzmq3-dev \
# Note: libacars-dev not in Debian repos, will be built from source in dumpvdl2-build stage
# readsb dependencies
libncurses-dev \
zlib1g-dev \
libzstd-dev \
# SDR++ dependencies
libglfw3-dev \
libglew-dev \
libvolk2-dev \
librtaudio-dev \
libiio-dev \
libad9361-dev \
libcjson-dev \
# utilities
curl \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# ============================================================================
# Stage: runtime-base
# Purpose: Minimal runtime dependencies (no build tools)
# Size: ~80MB
# ============================================================================
FROM debian:bookworm-slim AS runtime-base
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends \
# Runtime audio libraries
libsndfile1 \
libopus0 \
libopusfile0 \
libvorbis0a \
libogg0 \
libflac12 \
libavformat59 \
libavcodec59 \
libswresample4 \
libpulse0 \
# Runtime SDR libraries
librtlsdr0 \
libhackrf0 \
libairspy0 \
libairspyhf1 \
libsoapysdr0.8 \
libusb-1.0-0 \
udev \
# dsd-fme runtime
libitpp8v5 \
libfftw3-single3 \
libfftw3-double3 \
# direwolf runtime
libasound2 \
libgps28 \
libhamlib4 \
# dumpvdl2 runtime
libglib2.0-0 \
libsqlite3-0 \
libzmq5 \
# Note: libacars is statically linked in dumpvdl2
# readsb runtime
libncurses6 \
zlib1g \
libzstd1 \
libcjson1 \
# Runtime utilities
ca-certificates \
curl \
tini \
xz-utils \
sox \
libsox-fmt-all \
libsox-fmt-all \
netcat-openbsd \
libsamplerate0 \
&& rm -rf /var/lib/apt/lists/*
# Install s6-overlay (PID 1 init system + service supervisor)
ARG S6_OVERLAY_VERSION=3.1.6.2
ARG S6_RO_PLATFORM=x86_64
ARG BUILDPLATFORM
# Auto-detect platform for s6-overlay
RUN if [ "${BUILDPLATFORM}" = "linux/arm64" ]; then \
S6_RO_PLATFORM=aarch64; \
elif [ "${BUILDPLATFORM}" = "linux/arm/v7" ]; then \
S6_RO_PLATFORM=armhf; \
fi && \
curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz | tar -xJ -C / && \
curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_RO_PLATFORM}.tar.xz | tar -xJ -C /
# Prepare s6-overlay environment
RUN mkdir -p /run/service && \
chmod 755 /run/service && \
mkdir -p /etc/s6-overlay/s6-rc.d
ENTRYPOINT ["/init"]
# ============================================================================
# Stage: sdrpp-build
# Purpose: Build SDR++ server
# Size: ~800MB (not in final image)
# ============================================================================
FROM base-deps AS sdrpp-build
WORKDIR /build
# Build SDR++
RUN git clone --depth 1 --branch nightly https://github.com/AlexandreRouma/SDRPlusPlus.git && \
cd SDRPlusPlus && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_INTERNAL_GLFW=ON \
-DUSE_BUNDLE_GLFW=ON \
-DOPT_BUILD_M17_DECODER=OFF \
.. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: dsd-fme-build
# Purpose: Build dsd-fme decoder (DMR, P25, YSF, D-Star, etc.)
# Size: ~300MB (not in final image)
# ============================================================================
FROM base-deps AS dsd-fme-build
WORKDIR /build
# Build mbelib first (not in Debian repos)
RUN git clone --depth 1 https://github.com/szechyjs/mbelib.git && \
cd mbelib && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
ldconfig
# Build dsd-fme
RUN git clone --depth 1 https://github.com/lwvmobile/dsd-fme.git && \
cd dsd-fme && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: multimon-ng-build
# Purpose: Build multimon-ng decoder (POCSAG, FLEX, EAS, DTMF, etc.)
# Size: ~200MB (not in final image)
# ============================================================================
FROM base-deps AS multimon-ng-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/EliasOenal/multimon-ng.git && \
cd multimon-ng && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: rtl433-build
# Purpose: Build rtl_433 decoder (ISM sensors, weather stations, etc.)
# Size: ~250MB (not in final image)
# ============================================================================
FROM base-deps AS rtl433-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/merbanan/rtl_433.git && \
cd rtl_433 && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: acarsdec-build
# Purpose: Build acarsdec decoder (ACARS aircraft data link)
# Size: ~150MB (not in final image)
# ============================================================================
FROM base-deps AS acarsdec-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/f00b4r0/acarsdec.git && \
cd acarsdec && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: ais-catcher-build
# Purpose: Build AIS-catcher decoder (Maritime AIS transponders)
# Size: ~200MB (not in final image)
# ============================================================================
FROM base-deps AS ais-catcher-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/jvde-github/AIS-catcher.git && \
cd AIS-catcher && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
cp AIS-catcher /usr/local/bin/
# ============================================================================
# Stage: direwolf-build
# Purpose: Build direwolf decoder (APRS amateur radio packets)
# Size: ~180MB (not in final image)
# ============================================================================
FROM base-deps AS direwolf-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/wb2osz/direwolf.git && \
cd direwolf && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: dumpvdl2-build
# Purpose: Build dumpvdl2 decoder (VDL Mode 2 aviation data link)
# Size: ~200MB (not in final image)
# ============================================================================
FROM base-deps AS dumpvdl2-build
WORKDIR /build
# Build libacars first (not available in Debian repos)
RUN git clone --depth 1 https://github.com/szpajder/libacars.git && \
cd libacars && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
ldconfig
# Build dumpvdl2
RUN git clone --depth 1 https://github.com/szpajder/dumpvdl2.git && \
cd dumpvdl2 && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: readsb-build
# Purpose: Build readsb decoder (ADS-B aircraft transponders)
# Size: ~150MB (not in final image)
# ============================================================================
FROM base-deps AS readsb-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/wiedehopf/readsb.git && \
cd readsb && \
make -j2 RTLSDR=yes OPTIMIZE="-O1" && \
cp readsb /usr/local/bin/
# ============================================================================
# Stage: soapy-rtltcp-build
# Purpose: Build SoapyRTLTCP module for rtl_tcp network SDR support
# Size: ~50MB (not in final image)
# ============================================================================
FROM base-deps AS soapy-rtltcp-build
WORKDIR /build
RUN git clone --depth 1 https://github.com/pothosware/SoapyRTLTCP.git && \
cd SoapyRTLTCP && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: csdr-build
# Purpose: Build csdr command-line SDR tools for FM demodulation
# Size: ~100MB (not in final image)
# ============================================================================
FROM base-deps AS csdr-build
WORKDIR /build
# Install libsamplerate (required by csdr)
RUN apt-get update && apt-get install -y --no-install-recommends libsamplerate-dev
# Build csdr command-line tool
RUN git clone --depth 1 https://github.com/jketterl/csdr.git && \
cd csdr && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
make install
# ============================================================================
# Stage: node-build
# Purpose: Build WaveKit TypeScript application
# Size: ~450MB (not in final image)
# ============================================================================
FROM node:22-bookworm-slim AS node-build
WORKDIR /app
# Use Corepack to install the exact pnpm version from packageManager
RUN corepack enable && corepack prepare pnpm@10.28.0 --activate
# Copy workspace manifests and install dependencies
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json turbo.json .npmrc ./
COPY packages/shared/package.json packages/shared/tsconfig.json ./packages/shared/
COPY packages/api-types/package.json packages/api-types/tsconfig.json ./packages/api-types/
COPY cli/package.json cli/tsconfig.json ./cli/
COPY packages/sdr-host/package.json packages/sdr-host/tsconfig.json ./packages/sdr-host/
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
pnpm install --frozen-lockfile --prod=false
# Copy source code
COPY . .
# In Docker builds, prefer a hoisted node_modules layout for maximum tool compatibility
RUN pnpm config set node-linker hoisted --location=project && \
pnpm config set enable-global-virtual-store false --location=project
# Re-link dependencies under the selected node-linker (fast with cached store)
RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
CI=true pnpm install --frozen-lockfile --prod=false
# Run type checking (cache Turbo + TS incremental artifacts)
RUN --mount=type=cache,target=/root/.cache/turbo,sharing=locked \
--mount=type=cache,target=/app/node_modules/.cache,sharing=locked \
pnpm run typecheck
# Build application (cache Turbo artifacts)
RUN --mount=type=cache,target=/root/.cache/turbo,sharing=locked \
--mount=type=cache,target=/app/node_modules/.cache,sharing=locked \
pnpm run build
# Prune dev dependencies for smaller final image
RUN CI=true pnpm prune --prod
# Verify built output
RUN ls -la dist/ && head -1 dist/index.js
# ============================================================================
# Stage: final (full mode)
# Purpose: Complete runtime with all components
# Size: ~1.2GB
# ============================================================================
FROM runtime-base AS final
# Metadata
LABEL maintainer="WaveKit Contributors"
LABEL description="SDR stream processing framework with integrated decoders"
LABEL version="1.0.0"
# Environment setup
ENV WAVEKIT_HOME=/app \
WAVEKIT_CONFIG_PATH=/app/config \
WAVEKIT_LOG_LEVEL=info \
NODE_ENV=production \
PATH=/usr/local/bin:/usr/local/sbin:${PATH}
# Create application directory structure
RUN mkdir -p /app /var/log/wavekit /var/run/wavekit && \
chmod 755 /app /var/log/wavekit /var/run/wavekit
# Copy SDR++ from build stage
COPY --from=sdrpp-build /usr/local/bin/sdrpp* /usr/local/bin/
COPY --from=sdrpp-build /usr/local/lib/libsdrpp* /usr/local/lib/
# Copy decoders from build stages
COPY --from=dsd-fme-build /usr/local/bin/dsd* /usr/local/bin/
COPY --from=dsd-fme-build /usr/local/lib/libmbe* /usr/local/lib/
COPY --from=multimon-ng-build /usr/local/bin/multimon-ng /usr/local/bin/
COPY --from=rtl433-build /usr/local/bin/rtl_433 /usr/local/bin/
COPY --from=acarsdec-build /usr/local/bin/acarsdec /usr/local/bin/
COPY --from=ais-catcher-build /usr/local/bin/AIS-catcher /usr/local/bin/
COPY --from=direwolf-build /usr/local/bin/direwolf /usr/local/bin/
COPY --from=direwolf-build /usr/local/bin/decode_aprs /usr/local/bin/
COPY --from=direwolf-build /usr/local/bin/gen_packets /usr/local/bin/
COPY --from=dumpvdl2-build /usr/local/bin/dumpvdl2 /usr/local/bin/
COPY --from=dumpvdl2-build /usr/local/lib/libacars* /usr/local/lib/
COPY --from=readsb-build /usr/local/bin/readsb /usr/local/bin/
# Copy SoapyRTLTCP module for rtl_tcp network SDR support (acarsdec, dumpvdl2)
COPY --from=soapy-rtltcp-build /usr/local/lib/SoapySDR/modules0.8/librtltcpSupport.so /usr/local/lib/SoapySDR/modules0.8/
# Copy csdr for FM demodulation (audio-from-IQ decoders)
COPY --from=csdr-build /usr/local/bin/csdr /usr/local/bin/
COPY --from=csdr-build /usr/local/lib/libcsdr* /usr/local/lib/
# Update library cache for all copied libraries
RUN ldconfig
# Verify all 8 decoder installations
RUN echo "Verifying decoder installations..." && \
dsd-fme --version && \
multimon-ng -h > /dev/null 2>&1 && \
rtl_433 -V && \
acarsdec -h > /dev/null 2>&1 || true && \
AIS-catcher -h > /dev/null 2>&1 || true && \
direwolf -h > /dev/null 2>&1 || true && \
dumpvdl2 --version && \
readsb --version && \
csdr --help > /dev/null 2>&1 && \
echo "All 8 decoders + csdr verified successfully"
# Copy Node.js application
COPY --from=node-build /usr/local/bin/node /usr/local/bin/
COPY --from=node-build /app/dist /app/dist
COPY --from=node-build /app/node_modules /app/node_modules
COPY --from=node-build /app/packages/shared/package.json /app/packages/shared/package.json
COPY --from=node-build /app/packages/shared/dist /app/packages/shared/dist
COPY --from=node-build /app/packages/api-types/package.json /app/packages/api-types/package.json
COPY --from=node-build /app/packages/api-types/dist /app/packages/api-types/dist
COPY --from=node-build /app/config /app/config
COPY --from=node-build /app/package.json /app/
# Copy helper scripts
COPY docker/scripts/init-system.sh /usr/local/bin/
COPY docker/scripts/start-api.sh /usr/local/bin/
COPY docker/scripts/finish-api.sh /usr/local/bin/
COPY docker/scripts/start-sdrpp.sh /usr/local/bin/
COPY docker/scripts/finish-sdrpp.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/init-system.sh /usr/local/bin/start-api.sh /usr/local/bin/finish-api.sh /usr/local/bin/start-sdrpp.sh /usr/local/bin/finish-sdrpp.sh
# Copy s6-overlay service definitions
COPY docker/overlay/s6-overlay/s6-rc.d /etc/s6-overlay/s6-rc.d
# Make service scripts executable
RUN chmod -R 755 /etc/s6-overlay/s6-rc.d
# Create health check endpoint wrapper
RUN mkdir -p /etc/s6-overlay/scripts
COPY docker/scripts/healthcheck.sh /etc/s6-overlay/scripts/
RUN chmod 755 /etc/s6-overlay/scripts/healthcheck.sh
# Copy direwolf configuration
COPY docker/config/direwolf.conf /etc/direwolf.conf
# Expose ports
EXPOSE 9000 \
8080 \
5259 \
7355 \
4713
# Volume mounts
VOLUME ["/var/log/wavekit", "/var/run/wavekit", "/recordings"]
# Health check using s6-svstat
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD s6-svstat -u /run/service/wavekit-api > /dev/null 2>&1 || exit 1
# Start with s6-init (PID 1)
CMD ["/init"]
# ============================================================================
# Stage: final-core (core mode - no SDR++)
# Purpose: Lightweight API + decoders (SDR++ externalized)
# Size: ~550MB
# ============================================================================
FROM runtime-base AS final-core
LABEL maintainer="WaveKit Contributors"
LABEL description="WaveKit API + decoders (SDR++ externalized)"
LABEL mode="core"
ENV WAVEKIT_HOME=/app \
WAVEKIT_CONFIG_PATH=/app/config \
WAVEKIT_LOG_LEVEL=info \
NODE_ENV=production \
PATH=/usr/local/bin:/usr/local/sbin:${PATH}
RUN mkdir -p /app /var/log/wavekit /var/run/wavekit && \
chmod 755 /app /var/log/wavekit /var/run/wavekit
# Copy decoders only (no SDR++)
COPY --from=dsd-fme-build /usr/local/bin/dsd* /usr/local/bin/
COPY --from=dsd-fme-build /usr/local/lib/libmbe* /usr/local/lib/
COPY --from=multimon-ng-build /usr/local/bin/multimon-ng /usr/local/bin/
COPY --from=rtl433-build /usr/local/bin/rtl_433 /usr/local/bin/
COPY --from=acarsdec-build /usr/local/bin/acarsdec /usr/local/bin/
COPY --from=ais-catcher-build /usr/local/bin/AIS-catcher /usr/local/bin/
COPY --from=direwolf-build /usr/local/bin/direwolf /usr/local/bin/
COPY --from=direwolf-build /usr/local/bin/decode_aprs /usr/local/bin/
COPY --from=direwolf-build /usr/local/bin/gen_packets /usr/local/bin/
COPY --from=dumpvdl2-build /usr/local/bin/dumpvdl2 /usr/local/bin/
COPY --from=dumpvdl2-build /usr/local/lib/libacars* /usr/local/lib/
COPY --from=readsb-build /usr/local/bin/readsb /usr/local/bin/
# Copy SoapyRTLTCP module for rtl_tcp network SDR support (acarsdec, dumpvdl2)
COPY --from=soapy-rtltcp-build /usr/local/lib/SoapySDR/modules0.8/librtltcpSupport.so /usr/local/lib/SoapySDR/modules0.8/
# Copy csdr for FM demodulation (audio-from-IQ decoders)
COPY --from=csdr-build /usr/local/bin/csdr /usr/local/bin/
COPY --from=csdr-build /usr/local/lib/libcsdr* /usr/local/lib/
# Copy ncurses libraries from build stage to ensure version compatibility
COPY --from=dsd-fme-build /usr/lib/x86_64-linux-gnu/libncurses* /usr/lib/x86_64-linux-gnu/
# Run ldconfig to update cache
RUN ldconfig
# Copy direwolf configuration
COPY docker/config/direwolf.conf /etc/direwolf.conf
# Copy Node.js application
COPY --from=node-build /usr/local/bin/node /usr/local/bin/
COPY --from=node-build /app/dist /app/dist
COPY --from=node-build /app/node_modules /app/node_modules
COPY --from=node-build /app/packages/shared/package.json /app/packages/shared/package.json
COPY --from=node-build /app/packages/shared/dist /app/packages/shared/dist
COPY --from=node-build /app/packages/api-types/package.json /app/packages/api-types/package.json
COPY --from=node-build /app/packages/api-types/dist /app/packages/api-types/dist
COPY --from=node-build /app/config /app/config
COPY --from=node-build /app/package.json /app/
# Copy helper scripts
COPY docker/scripts/init-system.sh /usr/local/bin/
COPY docker/scripts/start-api.sh /usr/local/bin/
COPY docker/scripts/finish-api.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/init-system.sh /usr/local/bin/start-api.sh /usr/local/bin/finish-api.sh
# Copy s6-overlay service definitions (without sdrpp)
COPY docker/overlay/s6-overlay/s6-rc.d /etc/s6-overlay/s6-rc.d
RUN chmod -R 755 /etc/s6-overlay/s6-rc.d && \
rm -rf /etc/s6-overlay/s6-rc.d/sdrpp-server && \
rm -f /etc/s6-overlay/s6-rc.d/wavekit-api/dependencies.d/sdrpp-server && \
rm -f /etc/s6-overlay/s6-rc.d/user/contents.d/sdrpp-server && \
rm -f /etc/s6-overlay/s6-rc.d/services/contents.d/sdrpp-server
COPY docker/scripts/healthcheck.sh /etc/s6-overlay/scripts/
RUN chmod 755 /etc/s6-overlay/scripts/healthcheck.sh
EXPOSE 9000 8080 4713
VOLUME ["/var/log/wavekit", "/var/run/wavekit"]
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD s6-svstat -u /run/service/wavekit-api > /dev/null 2>&1 || exit 1
ENTRYPOINT ["/init"]
# ============================================================================
# Stage: final-sdrpp (sdrpp-only mode)
# Purpose: Just SDR++ server for dedicated SDR host
# Size: ~450MB
# ============================================================================
FROM runtime-base AS final-sdrpp
LABEL maintainer="WaveKit Contributors"
LABEL description="SDR++ server only (IQ/audio provider)"
LABEL mode="sdrpp-only"
ENV SDR_HOME=/sdr \
LOG_LEVEL=info
RUN mkdir -p /sdr /var/log/sdrpp && \
chmod 755 /sdr /var/log/sdrpp
# Copy only SDR++
COPY --from=sdrpp-build /usr/local/bin/sdrpp* /usr/local/bin/
COPY --from=sdrpp-build /usr/local/lib/libsdrpp* /usr/local/lib/
RUN ldconfig
# Copy helper scripts
COPY docker/scripts/start-sdrpp.sh /usr/local/bin/
COPY docker/scripts/finish-sdrpp.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/start-sdrpp.sh /usr/local/bin/finish-sdrpp.sh
# Basic service setup for SDR++
COPY docker/overlay/s6-overlay/s6-rc.d/base /etc/s6-overlay/s6-rc.d/base
COPY docker/overlay/s6-overlay/s6-rc.d/sdrpp-server /etc/s6-overlay/s6-rc.d/sdrpp-server
RUN chmod -R 755 /etc/s6-overlay/s6-rc.d
EXPOSE 5259
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
CMD s6-svstat -u /run/service/sdrpp-server > /dev/null 2>&1 || exit 1
ENTRYPOINT ["/init"]
# ============================================================================
# Default target (full mode)
# ============================================================================
FROM final AS default