The current Dockerfile utilizes a two-stage build process where the builder stage installs all dependencies via npm ci, including mediasoup (v3.19.14), and generates the Nuxt output in .output/server/index.mjs. The runner stage copies only the .output directory from the builder, excluding node_modules.
While standard JavaScript packages are bundled into the Nuxt server output, mediasoup is a complex native module that relies on platform-specific binaries and pre-compiled addons located within node_modules. If the Nuxt build process does not statically bundle these native components or if the runtime environment requires access to the original node_modules structure for dynamic resolution, the production container will fail to start or crash when attempting to initialize WebRTC streaming capabilities. Additionally, differences in architecture or OS between the builder and runner stages could result in incompatible binaries if they are expected but missing.
Proposed work
Modify the Dockerfile to ensure that necessary node_modules dependencies are available in the runner stage alongside the Nuxt output. This involves copying the node_modules directory from the builder stage to the /app/node_modules path in the runner stage, ensuring that native modules like mediasoup are accessible at runtime.
Acceptance criteria
The Docker image builds successfully without errors regarding missing modules or permission issues.
The application starts and serves traffic on port 3000 within the container.
WebRTC streaming features (mediasoup) function correctly, verifying that native binaries are loaded without ModuleNotFoundError or similar runtime exceptions.
The runner stage retains the non-root user execution (USER node) for security compliance.
Implementation notes
File to modify: Dockerfile.
Current runner stage copies only /app/.output. A new COPY --from=builder instruction is needed to transfer node_modules.
Ensure the copy preserves ownership or sets correct permissions for the node user, as the builder runs as root.
Reference: package.json lists mediasoup as a production dependency, and README.md confirms its use for live streaming.
Test plan
Build the Docker image locally using the modified Dockerfile.
Run the container and verify application startup logs show no missing module warnings.
Initiate a WebRTC session (e.g., via the "Share live" feature documented in README.md) to confirm successful connection and media handling.
## Context
The current `Dockerfile` utilizes a two-stage build process where the `builder` stage installs all dependencies via `npm ci`, including `mediasoup` (v3.19.14), and generates the Nuxt output in `.output/server/index.mjs`. The `runner` stage copies only the `.output` directory from the builder, excluding `node_modules`.
While standard JavaScript packages are bundled into the Nuxt server output, `mediasoup` is a complex native module that relies on platform-specific binaries and pre-compiled addons located within `node_modules`. If the Nuxt build process does not statically bundle these native components or if the runtime environment requires access to the original `node_modules` structure for dynamic resolution, the production container will fail to start or crash when attempting to initialize WebRTC streaming capabilities. Additionally, differences in architecture or OS between the builder and runner stages could result in incompatible binaries if they are expected but missing.
## Proposed work
Modify the Dockerfile to ensure that necessary `node_modules` dependencies are available in the `runner` stage alongside the Nuxt output. This involves copying the `node_modules` directory from the `builder` stage to the `/app/node_modules` path in the `runner` stage, ensuring that native modules like `mediasoup` are accessible at runtime.
## Acceptance criteria
- The Docker image builds successfully without errors regarding missing modules or permission issues.
- The application starts and serves traffic on port 3000 within the container.
- WebRTC streaming features (mediasoup) function correctly, verifying that native binaries are loaded without `ModuleNotFoundError` or similar runtime exceptions.
- The `runner` stage retains the non-root user execution (`USER node`) for security compliance.
## Implementation notes
- File to modify: `Dockerfile`.
- Current `runner` stage copies only `/app/.output`. A new `COPY --from=builder` instruction is needed to transfer `node_modules`.
- Ensure the copy preserves ownership or sets correct permissions for the `node` user, as the builder runs as root.
- Reference: `package.json` lists `mediasoup` as a production dependency, and `README.md` confirms its use for live streaming.
## Test plan
- Build the Docker image locally using the modified `Dockerfile`.
- Run the container and verify application startup logs show no missing module warnings.
- Initiate a WebRTC session (e.g., via the "Share live" feature documented in `README.md`) to confirm successful connection and media handling.
<!-- jasper-fp:c81159b429ed1b41 -->
Issue #34 has the identical title "Fix Docker multi-stage build to include native dependencies for mediasoup runtime" and is closed; the avoid list already denied this as close_duplicate referencing #34
Closing as duplicate after self-audit.
Issue #34 has the identical title "Fix Docker multi-stage build to include native dependencies for mediasoup runtime" and is closed; the avoid list already denied this as close_duplicate referencing #34
Evidence: Sibling #34
_Audited 2026-08-02T19:53:36Z_
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
The current
Dockerfileutilizes a two-stage build process where thebuilderstage installs all dependencies vianpm ci, includingmediasoup(v3.19.14), and generates the Nuxt output in.output/server/index.mjs. Therunnerstage copies only the.outputdirectory from the builder, excludingnode_modules.While standard JavaScript packages are bundled into the Nuxt server output,
mediasoupis a complex native module that relies on platform-specific binaries and pre-compiled addons located withinnode_modules. If the Nuxt build process does not statically bundle these native components or if the runtime environment requires access to the originalnode_modulesstructure for dynamic resolution, the production container will fail to start or crash when attempting to initialize WebRTC streaming capabilities. Additionally, differences in architecture or OS between the builder and runner stages could result in incompatible binaries if they are expected but missing.Proposed work
Modify the Dockerfile to ensure that necessary
node_modulesdependencies are available in therunnerstage alongside the Nuxt output. This involves copying thenode_modulesdirectory from thebuilderstage to the/app/node_modulespath in therunnerstage, ensuring that native modules likemediasoupare accessible at runtime.Acceptance criteria
ModuleNotFoundErroror similar runtime exceptions.runnerstage retains the non-root user execution (USER node) for security compliance.Implementation notes
Dockerfile.runnerstage copies only/app/.output. A newCOPY --from=builderinstruction is needed to transfernode_modules.nodeuser, as the builder runs as root.package.jsonlistsmediasoupas a production dependency, andREADME.mdconfirms its use for live streaming.Test plan
Dockerfile.README.md) to confirm successful connection and media handling.Closing as duplicate after self-audit.
Issue #34 has the identical title "Fix Docker multi-stage build to include native dependencies for mediasoup runtime" and is closed; the avoid list already denied this as close_duplicate referencing #34
Evidence: Sibling #34
Audited 2026-08-02T19:53:36Z