feat(audio): add audio server

This commit is contained in:
2026-07-06 19:33:25 +02:00
parent 122e0fb932
commit 489d7c645b
4 changed files with 73 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
FROM node:18-bookworm-slim
# Install PipeWire, WirePlumber, PulseAudio compat, ALSA, and D-Bus
RUN apt-get update && apt-get install -y \
pipewire \
pipewire-pulse \
pipewire-alsa \
wireplumber \
dbus-x11 \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Clone and build the PipeWire Web Remote interface
RUN git clone https://github.com/oudeis01/pipewire-web-remote.git . \
&& npm install \
&& npm run build
COPY start.sh /start.sh
RUN chmod +x /start.sh
# The Web UI defaults to 8080
EXPOSE 8080
CMD ["/start.sh"]
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Setup directories for PipeWire and PulseAudio sockets
export XDG_RUNTIME_DIR=/tmp
mkdir -p /tmp/pulse
mkdir -p /tmp/pipewire-0
# Initialize local DBus session (required by PipeWire/WirePlumber)
export DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --session --print-address --fork)
echo "Starting PipeWire..."
pipewire &
sleep 1
echo "Starting WirePlumber session manager..."
wireplumber &
sleep 1
echo "Starting PipeWire-Pulse compatibility layer..."
pipewire-pulse &
sleep 1
# Ensure the PulseAudio socket is accessible to other containers
chmod -R 777 /tmp/pulse || true
echo "Starting PipeWire Web Remote..."
exec npm start
+18
View File
@@ -16,15 +16,28 @@ services:
environment: environment:
- DISPLAY=:0 - DISPLAY=:0
audio-manager:
build: ./audio-manager
restart: always
privileged: true # Required for proper ALSA/Hardware audio access in some setups
ports:
- "8080:8080"
volumes:
- pulse-socket:/tmp/pulse
devices:
- "/dev/snd:/dev/snd"
kiosk-1: kiosk-1:
build: ./kiosk build: ./kiosk
restart: always restart: always
depends_on: depends_on:
- display-manager - display-manager
- audio-manager
ports: ports:
- "5011:5011" - "5011:5011"
volumes: volumes:
- x11-socket:/tmp/.X11-unix - x11-socket:/tmp/.X11-unix
- pulse-socket:/tmp/pulse
devices: devices:
- "/dev/dri:/dev/dri" - "/dev/dri:/dev/dri"
environment: environment:
@@ -34,16 +47,19 @@ services:
- LAUNCH_URL=https://github.com - LAUNCH_URL=https://github.com
- KIOSK=1 - KIOSK=1
- GPU=1 - GPU=1
- PULSE_SERVER=unix:/tmp/pulse/native
kiosk-2: kiosk-2:
build: ./kiosk build: ./kiosk
restart: always restart: always
depends_on: depends_on:
- display-manager - display-manager
- audio-manager
ports: ports:
- "5012:5012" - "5012:5012"
volumes: volumes:
- x11-socket:/tmp/.X11-unix - x11-socket:/tmp/.X11-unix
- pulse-socket:/tmp/pulse
devices: devices:
- "/dev/dri:/dev/dri" - "/dev/dri:/dev/dri"
environment: environment:
@@ -53,6 +69,8 @@ services:
- LAUNCH_URL=https://google.com - LAUNCH_URL=https://google.com
- KIOSK=1 - KIOSK=1
- GPU=1 - GPU=1
- PULSE_SERVER=unix:/tmp/pulse/native
volumes: volumes:
x11-socket: x11-socket:
pulse-socket:
+2
View File
@@ -7,6 +7,8 @@ RUN apt-get update && apt-get install -y \
scrot \ scrot \
jq \ jq \
curl \ curl \
libpulse0 \
alsa-utils \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app