Fix Docker multi-stage build to include native dependencies for mediasoup runtime #34

Open
opened 2026-06-17 09:34:13 +00:00 by jasper · 0 comments
Collaborator

Context

The current Dockerfile utilizes a multi-stage build strategy where the runner stage is based on node:24-slim. This slim image does not include the native system libraries or build tools required by the mediasoup server component. Consequently, when the application runs in Docker, it fails at runtime because the native binaries for WebRTC streaming are missing or incompatible.

Proposed work

Update the Dockerfile runner stage to install the necessary native dependencies for mediasoup before copying the application output from the builder stage. This may involve switching the base image to one that includes these dependencies (e.g., node:24-bookworm) or installing required system packages within the existing slim stage.

Acceptance criteria

  • The Docker container starts successfully without runtime errors related to missing native modules.
  • The WebRTC live streaming feature functions correctly within the Docker environment.
  • The application continues to run as a non-root user (node).

Implementation notes

  • File: Dockerfile
  • Current runner stage base image: node:24-slim
  • Dependency: mediasoup (requires native binaries)
  • Relevant environment variables for WebRTC: MEDIASOUP_ANNOUNCED_IP

Test plan

  • Build the Docker image using the updated Dockerfile.
  • Run the container and verify that the server process starts without crashing.
  • Attempt to initiate a live stream via the "Share live" feature to confirm WebRTC connectivity.
## Context The current `Dockerfile` utilizes a multi-stage build strategy where the runner stage is based on `node:24-slim`. This slim image does not include the native system libraries or build tools required by the `mediasoup` server component. Consequently, when the application runs in Docker, it fails at runtime because the native binaries for WebRTC streaming are missing or incompatible. ## Proposed work Update the `Dockerfile` runner stage to install the necessary native dependencies for mediasoup before copying the application output from the builder stage. This may involve switching the base image to one that includes these dependencies (e.g., `node:24-bookworm`) or installing required system packages within the existing slim stage. ## Acceptance criteria - [ ] The Docker container starts successfully without runtime errors related to missing native modules. - [ ] The WebRTC live streaming feature functions correctly within the Docker environment. - [ ] The application continues to run as a non-root user (`node`). ## Implementation notes - File: `Dockerfile` - Current runner stage base image: `node:24-slim` - Dependency: `mediasoup` (requires native binaries) - Relevant environment variables for WebRTC: `MEDIASOUP_ANNOUNCED_IP` ## Test plan - [ ] Build the Docker image using the updated `Dockerfile`. - [ ] Run the container and verify that the server process starts without crashing. - [ ] Attempt to initiate a live stream via the "Share live" feature to confirm WebRTC connectivity. <!-- jasper-fp:96520631eecf3fb2 -->
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: keligrubb/kestrelos#34