Skip to content

Deployment

Bennett Wu edited this page May 5, 2025 · 3 revisions

Node server and whisper service have prebuild Docker containers to help you get up and running easily. See Docker Deployment for instructions. If you don't wish to use Docker, node server and whisper service can also be run natively. See Native Deployment for instructions.

Docker Deployment

Before you start

  1. Ensure you have Docker installed
  2. Clone this repository and cd into it
    git clone https://github.com/scribear/ScribeAR-NodeServer && cd ScribeAR-NodeServer
    

Full Stack Deployment

  1. Move into the deployment directory
    cd deployment
    
  2. Make a copy of template.env and name it .env
  3. Make a copy of device_config.template.json and name it device_config.json
  4. Edit .env and device_config.json to configure both whisper service and node server.
    • Note: Configuration for Docker compose is modified from regular configuration.
      • HOST and PORT for whisper service and node server are disabled.
      • WHISPER_SERVICE_ENDPOINT for node server is disabled.
      • NODE_PORT is added to configure the port node server will listen on (replaces PORT).
      • FRONTEND_PORT is added to be used for the ScribeAR frontend container. This is the port the frontend will listen on
      • SCRIBEAR_URL is added to configure the Frontend URL users who scan the QR code will be given. See Kiosk Mode for details.
      • WHISPER_SERVICE_CUDA is added (either true or false) to choose if whisper service is deployed with cuda support or not.
      • Everything else remains the same.
    • See Configuring Docker Containers for details about configuration.
  5. Pull the latest version of the Docker images
    • For CPU only deployment
      docker compose -f ./compose_cpu.yaml pull
      
    • For CUDA deployment
      docker compose -f ./compose_cuda.yaml pull
      
  6. Start containers and browser
    ./docker-autostart.sh
    
    • This will run docker compose -f ./compose_{cpu|cuda}.yaml up d and then open ScribeAR using Google Chrome in kiosk mode.
    • When Google Chrome exits the containers will be stopped.

Node Server Container

  1. Move into the node-server directory
    cd node-server
    
  2. Make a copy of template.env and name it .env
  3. Edit .env to configure node server.
    • The template already contains sensible defaults. A good place to start is to leave every thing except WHISPER_SERVICE_ENDPOINT and SOURCE_TOKEN default.
    • See Configuring Node Server for details about each option.
  4. Pull the latest version of the Docker image
    docker pull scribear/node-server:main
    
  5. Start the container (listening on port 8000)
    docker run -p 8000:80 --env-file .env scribear/node-server:main -d
    

Whisper Service Container

  1. Ensure you have Docker installed
  2. Clone this repository and navigate to the deployment folder
    git clone https://github.com/scribear/ScribeAR-NodeServer && cd deployment
    
  3. Make a copy of template.env and name it .env
  4. Make a copy of device_config.template.json and name it device_config.json
  5. Edit .env and device_config.json to configure whisper service.
    • The templates already contain sensible defaults. A good place to start is to leave every thing except API_KEY default.
    • See Configuring Docker Containers for details about configuration.
  6. Pull the latest version of the Docker image
    • For CPU only deployment
      docker pull scribear/whisper-service-cpu:main
      
    • For CUDA deployment
      docker pull scribear/whisper-service-cuda:main
      
  7. Start the container (listening on port 8000)
    • For CPU only deployment
      docker run -p 8000:80 --env-file .env -v ./device_config.json:/app/device_config.json scribear/whisper-service-cpu:main -d
      
    • For CUDA deployment
      docker run -p 8000:80 --env-file .env -v ./device_config.json:/app/device_config.json scribear/whisper-service-cuda:main -d
      

Native Deployment

Full Stack Native Deployment

Deploys node-server, whisper-service, and ScribeAR frontend to be running on the same system.

  1. Ensure Node.js, Python 3, and Google Chrome are installed on your machine
  2. Clone this repository
    git clone https://github.com/scribear/ScribeAR-NodeServer
    
  3. Setup whisper-service
    cd ScribeAR-NodeServer/whisper-service
    
    python3 -m venv .venv
    
    . .venv/bin/activate
    
    pip install -r requirements.txt
    
  4. Make a copy of device_config.template.json and name it device_config.json
  5. Edit .env and device_config.json to configure whisper service.
    • The templates already contain sensible defaults. A good place to start is to leave every thing except API_KEY default.
    • See Configuring Whisper Service for details about configuration.
  6. Build node-server
    cd ../node-server
    
    npm install
    
    npm run build
    
  7. Edit .env to configure node server.
    • The template already contains sensible defaults. A good place to start is to leave every thing except WHISPER_SERVICE_ENDPOINT and SOURCE_TOKEN default.
    • See Configuring Node Server for details about each option.
  8. Move to the deployment directory
    cd ../deployment
    
  9. Configure the aio-autostart.sh script by editing the beginning of the script to change these variables:
    • NODE_PORT is the port the node server is listening on. This should match what was configured in .env
    • SOURCE_TOKEN is the source token the node server is configured with. This should match what was configured in .env
    • SCRIBEAR_URL is added to configure the Frontend URL users who scan the QR code will be given. See Kiosk Mode for details.
  10. The aio-autostart.sh script can then be used to start whisper service, node server, and google chrome automatically.
    ./aio-autostart.sh
    

Note: The aio-autostart.sh script can then be used to start whisper service, node server, and google chrome automatically on startup. Set this to automatically run on login with a user that is automatically logged in to have a hands free startup.

  • For Ubuntu, this can be achieved using by creating the following file at ~/.config/autostart/aio-autostart.desktop
    [Desktop Entry]
    Type=Application
    Exec= { PATH TO aio-autostart.sh SCRIPT }
    NoDisplay=false
    X-GNOME-Autostart-enabled=true
    Terminal=true
    

Native Node Service

  1. Ensure that Node.js is installed on your machine
  2. Clone this repository
    git clone https://github.com/scribear/ScribeAR-NodeServer
    
  3. Build node-server
    cd ../node-server
    
    npm install
    
    npm run build
    
  4. Edit .env to configure node server.
    • The template already contains sensible defaults. A good place to start is to leave every thing except WHISPER_SERVICE_ENDPOINT and SOURCE_TOKEN default.
    • See Configuring Node Server for details about each option.
  5. Start the server
    npm start
    

Native Whisper Service

  1. Ensure Python 3 is installed on your machine
  2. Clone this repository
    git clone https://github.com/scribear/ScribeAR-NodeServer
    
  3. Setup whisper-service
    cd ScribeAR-NodeServer/whisper-service
    
    python3 -m venv .venv
    
    . .venv/bin/activate
    
    pip install -r requirements.txt
    
  4. Make a copy of device_config.template.json and name it device_config.json
  5. Edit .env and device_config.json to configure whisper service.
    • The templates already contain sensible defaults. A good place to start is to leave every thing except API_KEY default.
    • See Configuring Whisper Service for details about configuration.
  6. Start the service
    python index.py
    
Clone this wiki locally