For the complete documentation index, see llms.txt. This page is also available as Markdown.

Docker for Node.js

Run the VIESUS Node.js module in a GPU-enabled Docker container. Dockerfile, build, and run instructions for Linux production deployments.

Linux Only

The VIESUS Node.js module is available on Linux only.

Containerizing the Node.js module follows the same foundation as the CLI Docker setup — the VIESUS .deb packages are installed inside the container, then the npm module is linked from the installed location.


Prerequisites

  • Docker Engine installed on the host

  • NVIDIA Container Toolkit installed (for GPU support)

  • VIESUS .deb packages (.deb files must be in your build context)

If you do not already have the NVIDIA Container Toolkit:

# Add NVIDIA Container Toolkit repository
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
  sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
  sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

Build context

Prepare the directory you'll build from:


Dockerfile

The nvidia/cuda base image tag (12.6.0-runtime-ubuntu22.04) must match your host NVIDIA driver. Check the NVIDIA Container Registry for available tags and replace 12.6.0 as needed.


Build the image


Run the container

CPU mode

GPU mode

When using GPUs, set UV_THREADPOOL_SIZE to the number of GPUs, not the number of CPU cores. See GPU Scaling.


Passing the GUID securely

Never hardcode the GUID in the Dockerfile or application code. Pass it at runtime:

Read the GUID in your application:


Docker Compose example

Run with:


Production considerations

Topic
Recommendation

Image size

Use multi-stage builds to reduce final image size; the CUDA runtime base is large

GUID security

Pass via environment variable or secret manager — never bake into the image

Graceful shutdown

Handle SIGTERM to allow in-flight requests to complete before the pool closes

Health check

Add a lightweight GET /health endpoint that returns 200; use it for readiness probes

Logging

Stream stdout/stderr — Docker captures it; ship to your log aggregator

GPU reservation

Use --gpus all or specify by device ID if only some GPUs should be used

Last updated

Was this helpful?