0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【備忘録】OpenNotebookのデータベース、ローカルホストURL変更

0
Last updated at Posted at 2026-04-21

OpenNotebookって?

https://github.com/lfnovo/open-notebook/tree/main
https://github.com/lfnovo/open-notebook/blob/main/docs/0-START-HERE/quick-start-local.md

NotebokLMのローカル版と考えればいい。自前のサーバーやPCがあればオフライン環境で
同じようなことができる。
MITライセンスのオープンソースとなる

修正する

Dockerのポート指定は"ホスト側ポート:コンテナ側ポートとなっている。
コンテナ内部のポート8000番は変えない(SurrealDBの起動コマンド内で --bind 0.0.0.0:8000と指定されているので)

surrealdb のポート設定: "8002:8000" に変更(8002番で受けて、コンテナの8000番に流す)。
open_notebook の接続先: コンテナ間通信は「サービス名:コンテナ内ポート」で行うため、ws://surrealdb:8000/rpc のまま

docker-compose.yml
services:
  surrealdb:
    image: surrealdb/surrealdb:v2
    # コンテナ内では8000番で起動
    command: start --user root --pass password --bind 0.0.0.0:8000 rocksdb:/mydata/mydatabase.db
    user: root
    ports:
      - "8002:8000"  # localhost:8002 でアクセス可能にする
#元は"8000:8000"となっている
    volumes:
      - ./surreal_data:/mydata

  open_notebook:
    image: lfnovo/open_notebook:v1-latest
    pull_policy: always
    ports:
      - "8502:8502"  # Web UI (React frontend)
      - "5055:5055"  # API (required!)
    environment:
      - OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string
      # 内部通信なので、surrealdbサービスの8000番を指定
      - SURREAL_URL=ws://surrealdb:8000/rpc
      - SURREAL_USER=root
      - SURREAL_PASSWORD=password
      - SURREAL_NAMESPACE=open_notebook
      - SURREAL_DATABASE=open_notebook
    volumes:
      - ./notebook_data:/app/data
    depends_on:
      - surrealdb
    restart: always

  ollama:
    image: ollama/ollama:latest
    ports:
      - "11434:11434"
    volumes:
      - ./ollama_models:/root/.ollama
    restart: always
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?