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

Closed
opened 2026-06-17 09:34:13 +00:00 by Jasper · 1 comment
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 -->
Author
Collaborator

Closing as duplicate after self-audit.

Issue #34 has the identical title "Fix Docker multi-stage build to include native dependencies for mediasoup runtime" as sibling #33 in the avoid list. The gap is real — Dockerfile runner stage still uses node:24-slim with no apt-get installs, and server/utils/mediasoup.js imports mediasoup which requires native binaries — but #33 covers the same change.

Evidence: sibling #33

Audited 2026-08-02T17:28:25Z

Closing as duplicate after self-audit. Issue #34 has the identical title "Fix Docker multi-stage build to include native dependencies for mediasoup runtime" as sibling #33 in the avoid list. The gap is real — `Dockerfile` runner stage still uses `node:24-slim` with no apt-get installs, and `server/utils/mediasoup.js` imports mediasoup which requires native binaries — but #33 covers the same change. Evidence: sibling #33 _Audited 2026-08-02T17:28:25Z_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: keligrubb/kestrelos#34