Skip to main content

1. Installation

We will again use our Dockervm to deploy this application via docker. The installation instructions can be found on their Github page but here is the compose file regardless ;)

compose.yml
services:
  surrealdb:
    image: surrealdb/surrealdb:v2
    # Credentials default to root:root for a zero-config local setup. Before
    # exposing this instance to a network, set SURREAL_USER / SURREAL_PASSWORD
    # in a .env file (see .env.example) — they are applied here and to the
    # open_notebook service below, so the two always stay in sync.
    command: start --log info --user ${SURREAL_USER:-root} --pass ${SURREAL_PASSWORD:-root} rocksdb:/mydata/mydatabase.db
    user: root  # Required for bind mounts on Linux
    ports:
      - "8000:8000"
    volumes:
      - ./surreal_data:/mydata
    environment:
      - SURREAL_EXPERIMENTAL_GRAPHQL=true
    restart: always
    pull_policy: always

  open_notebook:
    image: lfnovo/open_notebook:v1-latest
    ports:
      - "8502:8502"  # Web UI
      - "5055:5055"  # REST API
    environment:
      # REQUIRED: Change this to your own secret string
      # This encrypts your API keys in the database
      - OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string

      # Database connection. SURREAL_USER / SURREAL_PASSWORD default to root:root
      # for local use; override them in a .env file before exposing the instance
      # (the same values configure the surrealdb service above).
      - SURREAL_URL=ws://surrealdb:8000/rpc
      - SURREAL_USER=${SURREAL_USER:-root}
      - SURREAL_PASSWORD=${SURREAL_PASSWORD:-root}
      - SURREAL_NAMESPACE=open_notebook
      - SURREAL_DATABASE=open_notebook
      - API_URL=http://localhost:5055
      - OPEN_NOTEBOOK_PASSWORD=${OPEN_NOTEBOOK_PASSWORD:-secure-webgui-password}
    volumes:
      - ./notebook_data:/app/data
    depends_on:
      - surrealdb
    restart: always
    pull_policy: always

Just copy and paste this in your dockhand instance as a new stack. Just makes sure you change the SURREAL_USER, SURREAL_PASSWORD and the OPEN_NOTEBOOK_PASSWORD to something more complicated than root and root. You can do this in the environment variables section in the Dockhand Stack

Then just deploy the stack and visit it at http://IP-DOCKERVM:8052

Attach Domain Name

Now, if you want to attach a domain name to your open notebook instance then you need to make a tiny addition to your docker compose file environment variables. Namely the API URL needs to match your domain name. If for instance your URL is opennotebook.example.org then the add the following line to the environment variables of the opennotebook container.

      - API_URL=https://opennotebook.example.org