feat(audio): add audio server
This commit is contained in:
@@ -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"]
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user