version: "3.8"
services:
  surrealdb:
    image: surrealdb/surrealdb:v2
    ports:
      - 8000
    volumes:
      - ../files/surreal_data:/mydata
    command: start --user root --pass root rocksdb:/mydata/mydatabase.db
    pull_policy: always
    user: root

  open_notebook:
    image: lfnovo/open_notebook:latest
    ports:
      - 8502
    environment:
      - SURREAL_URL=ws://surrealdb:8000/rpc
      - SURREAL_USER=root
      - SURREAL_PASSWORD=root
      - SURREAL_NAMESPACE=open_notebook
      - SURREAL_DATABASE=staging
    depends_on:
      - surrealdb
    pull_policy: always
    volumes:
      - ../files/notebook_data:/app/data
