[Collaboration] WebSocket Node Server — Docker Guide

Guide for running the WebSocket-based real-time collaboration server in a Docker container.

The .tar file required to install and run the server is provided separately. Contact tech support for the file and detailed instructions.

Steps

Load the image

# Move to the directory containing the tar file
cd <path/to/tar>

# Load the tar file as an image
docker load -i <filename>.tar

# Example
cd C:/workspace
docker load -i collaboServer.tar

Verify the image

docker images

Start a container

docker run -e PORT=<container port> -p <host port>:<container port> <imageId>

# Example
docker run    -e PORT=1234 -p 1234:1234 0e8f4af55097
docker run -d -e PORT=1234 -p 1234:1234 0e8f4af55097   # background
  • Host port — external services hit this port on the host; traffic is forwarded into the container.
  • Container port — port the container listens on internally.

Logs

Via Docker

# All logs
docker logs <containerId>

# Follow
docker logs -f <containerId>

Log files

Stored as files in ./logs inside the container, split per day plus a separate error log. The logs cover:

  • Server startup and status
  • Document create / delete and user connection info
  • WebSocket and Redis errors
  • Exceptions

Verify a container is running

docker ps -a

Stop a container

docker stop <containerId>

# Example
docker stop 62409c6ddba3

Process Monitoring with PM2

# Open a shell inside the container
docker -it exec <containerId> /bin/bash

# Monitor processes
pm2 monit

PM2 keeps the Node.js process alive and restarts it after abnormal termination.