chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:10:23 +08:00
commit fbab2c6005
567 changed files with 114434 additions and 0 deletions
+167
View File
@@ -0,0 +1,167 @@
# Docker Compose Examples
This folder contains different `docker-compose.yml` configurations for various use cases.
It also includes an [`easypanel`](./easypanel/) template that can be copied into
the official EasyPanel templates repository and tested in the EasyPanel
templates playground.
## 📋 Available Examples
### `docker-compose-full-local.yml` - 100% Local AI (No Cloud APIs) 🌟
**Use this if:** You want complete privacy with zero external API dependencies
**Features:**
- **Ollama**: Local LLM and embeddings (mistral, llama, etc.)
- **Speaches**: Local TTS (text-to-speech) and STT (speech-to-text)
- Everything runs on your machine - nothing sent to cloud
- Perfect for privacy, offline work, or air-gapped environments
**Setup:**
1. Copy to your project folder as `docker-compose.yml`
2. Run: `docker compose up -d`
3. Download models (see file comments for commands)
4. Configure all providers in UI (detailed instructions in file)
**Requirements:**
- Minimum: 8GB RAM, 20GB disk, 4 CPU cores
- Recommended: 16GB+ RAM, NVIDIA GPU (8GB+ VRAM), 50GB disk
**Documentation:**
- [Local TTS Guide](../docs/5-CONFIGURATION/local-tts.md)
- [Local STT Guide](../docs/5-CONFIGURATION/local-stt.md)
---
### `docker-compose-speaches.yml` - Local Speech Processing
**Use this if:** You want free TTS/STT but use cloud LLMs
**Features:**
- **Speaches**: Local text-to-speech and speech-to-text
- Use with cloud LLM providers (OpenAI, Anthropic, etc.)
- Great for podcast generation without TTS API costs
- Private audio processing
**Setup:**
1. Copy to your project folder as `docker-compose.yml`
2. Run: `docker compose up -d`
3. Download speech models (see file for commands)
4. Configure cloud LLM + local Speaches in UI
**Documentation:**
- [Local TTS Guide](../docs/5-CONFIGURATION/local-tts.md)
- [Local STT Guide](../docs/5-CONFIGURATION/local-stt.md)
---
### `docker-compose-ollama.yml` - Free Local AI with Ollama
**Use this if:** You want to run AI models locally without API costs
**Features:**
- Includes Ollama service for local AI models
- No external API keys needed (for LLM and embeddings)
- Full privacy - everything runs on your machine
- Great for testing or privacy-focused deployments
**Setup:**
1. Copy to your project folder as `docker-compose.yml`
2. Run: `docker compose up -d`
3. Pull a model: `docker exec open_notebook-ollama-1 ollama pull mistral`
4. Configure in UI: Settings → API Keys → Add Ollama (URL: `http://ollama:11434`)
**Recommended models:**
- **LLM**: `mistral`, `llama3.1`, `qwen2.5`
- **Embeddings**: `nomic-embed-text`, `mxbai-embed-large`
---
### `docker-compose-single.yml` - Single Container (Deprecated)
**Use this if:** You need all services in one container (not recommended)
**⚠️ Deprecated:** We recommend using the standard multi-container setup (`docker-compose.yml` in root) for better reliability and easier troubleshooting.
**Features:**
- Single container includes SurrealDB, API, and Frontend
- Simpler for very constrained environments
- Less flexible for debugging and scaling
---
### `docker-compose-dev.yml` - Development Setup
**Use this if:** You're contributing to Open Notebook or developing custom features
**Features:**
- Hot-reload for code changes
- Separate backend and frontend services
- Build from source instead of using pre-built images
- Includes development tools and debugging
**Prerequisites:**
- Python 3.11+
- Node.js 18+
- uv (Python package manager)
**Setup:**
See [Development Guide](../docs/7-DEVELOPMENT/index.md)
---
## 🔄 How to Use These Examples
1. **Choose** the example that fits your use case
2. **Copy** the file to your project folder:
```bash
cp examples/docker-compose-ollama.yml docker-compose.yml
```
3. **Edit** the `OPEN_NOTEBOOK_ENCRYPTION_KEY` value
4. **Run** the services:
```bash
docker compose up -d
```
---
## 💡 Need a Custom Setup?
You can combine features from multiple examples. Common customizations:
### Add Ollama to Standard Setup
Add this to the main `docker-compose.yml`:
```yaml
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_models:/root/.ollama
restart: always
volumes:
ollama_models:
```
### Add Reverse Proxy
See [Reverse Proxy Guide](../docs/5-CONFIGURATION/reverse-proxy.md)
### Add Basic Auth
Add to `open_notebook` service environment:
```yaml
- BASIC_AUTH_USERNAME=admin
- BASIC_AUTH_PASSWORD=your-secure-password
```
---
## 📚 Documentation
- [Installation Guide](../docs/1-INSTALLATION/index.md)
- [Configuration Reference](../docs/5-CONFIGURATION/environment-reference.md)
- [Troubleshooting](../docs/6-TROUBLESHOOTING/index.md)
---
## 🆘 Need Help?
- **Discord**: [Join our community](https://discord.gg/37XJPXfz2w)
- **Issues**: [GitHub Issues](https://github.com/lfnovo/open-notebook/issues)
+30
View File
@@ -0,0 +1,30 @@
services:
surrealdb:
image: surrealdb/surrealdb:v2
volumes:
- ./surreal_data:/mydata
environment:
- SURREAL_EXPERIMENTAL_GRAPHQL=true
ports:
# Localhost only — the database uses default credentials, so never
# publish this port on 0.0.0.0
- "127.0.0.1:8000:8000"
command: start --log info --user root --pass root rocksdb:/mydata/mydatabase.db
pull_policy: always
user: root
restart: always
open_notebook:
build:
context: .
dockerfile: Dockerfile
ports:
- "8502:8502"
- "5055:5055"
env_file:
- ./docker.env
depends_on:
- surrealdb
volumes:
- ./notebook_data:/app/data
restart: always
+199
View File
@@ -0,0 +1,199 @@
# Docker Compose - 100% Local AI Setup
#
# This is the complete privacy-focused setup with NO external APIs needed:
# - Ollama: Local LLM and embeddings (mistral, llama, nomic-embed, etc.)
# - Speaches: Local TTS (text-to-speech) and STT (speech-to-text)
# - Open Notebook: Your research assistant
# - SurrealDB: Local database
#
# Perfect for:
# - Complete privacy (nothing leaves your machine)
# - Offline work
# - No API costs
# - Air-gapped environments
# - Testing and development
#
# Usage:
# 1. Copy this file to your project folder as docker-compose.yml
# 2. Change OPEN_NOTEBOOK_ENCRYPTION_KEY below
# 3. Run: docker compose up -d
# 4. Pull models (see instructions below)
# 5. Configure providers in UI
#
# Full documentation:
# - Ollama setup: https://github.com/lfnovo/open-notebook/blob/main/examples/README.md
# - TTS setup: https://github.com/lfnovo/open-notebook/blob/main/docs/5-CONFIGURATION/local-tts.md
# - STT setup: https://github.com/lfnovo/open-notebook/blob/main/docs/5-CONFIGURATION/local-stt.md
services:
surrealdb:
image: surrealdb/surrealdb:v2
command: start --log info --user root --pass root rocksdb:/mydata/mydatabase.db
user: root
ports:
# Localhost only — the database uses default credentials, so never
# publish this port on 0.0.0.0
- "127.0.0.1:8000:8000"
volumes:
- ./surreal_data:/mydata
environment:
- SURREAL_EXPERIMENTAL_GRAPHQL=true
restart: always
pull_policy: always
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_models:/root/.ollama
restart: always
pull_policy: always
# For GPU acceleration (NVIDIA), add:
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
speaches:
image: ghcr.io/speaches-ai/speaches:latest-cpu
container_name: speaches
ports:
- "8969:8000"
volumes:
- hf-hub-cache:/home/ubuntu/.cache/huggingface/hub
restart: unless-stopped
# For GPU acceleration, use: ghcr.io/speaches-ai/speaches:latest-cuda
# and add GPU device mapping (see docs)
open_notebook:
image: lfnovo/open_notebook:v1-latest
ports:
- "8502:8502"
- "5055:5055"
environment:
# REQUIRED: Change this to your own secret string
- OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string
# Database connection
- SURREAL_URL=ws://surrealdb:8000/rpc
- SURREAL_USER=root
- SURREAL_PASSWORD=root
- SURREAL_NAMESPACE=open_notebook
- SURREAL_DATABASE=open_notebook
# Ollama connection (optional, can also configure via UI)
- OLLAMA_BASE_URL=http://ollama:11434
volumes:
- ./notebook_data:/app/data
depends_on:
- surrealdb
- ollama
- speaches
restart: always
pull_policy: always
volumes:
ollama_models:
hf-hub-cache:
# ==========================================
# AFTER STARTING: Download Models
# ==========================================
#
# Ollama Models (LLM):
# docker exec open_notebook-ollama-1 ollama pull mistral
# docker exec open_notebook-ollama-1 ollama pull llama3.1
# docker exec open_notebook-ollama-1 ollama pull qwen2.5
#
# Ollama Models (Embeddings):
# docker exec open_notebook-ollama-1 ollama pull nomic-embed-text
# docker exec open_notebook-ollama-1 ollama pull mxbai-embed-large
#
# Speaches (TTS):
# docker compose exec speaches uv tool run speaches-cli model download speaches-ai/Kokoro-82M-v1.0-ONNX
#
# Speaches (STT):
# docker compose exec speaches uv tool run speaches-cli model download Systran/faster-whisper-small
#
# ==========================================
# CONFIGURATION IN OPEN NOTEBOOK
# ==========================================
#
# 1. Configure Ollama:
# - Go to Settings → API Keys
# - Add Credential → Select "Ollama"
# - Base URL: http://ollama:11434
# - Save → Test Connection → Discover Models → Register Models
#
# 2. Configure Speaches (TTS/STT):
# - Go to Settings → API Keys
# - Add Credential → Select "OpenAI-Compatible"
# - Name: "Local Speaches"
# - Base URL for TTS: http://host.docker.internal:8969/v1 (macOS/Windows)
# or: http://172.17.0.1:8969/v1 (Linux)
# - Base URL for STT: (same as TTS)
# - Save → Test Connection
#
# 3. Discover Speech Models:
# - In the Speaches credential you just created, click Discover Models
# - Select and register the models you need (e.g. TTS and STT)
# - If models aren't discovered automatically, add them manually:
# * TTS: speaches-ai/Kokoro-82M-v1.0-ONNX
# * STT: Systran/faster-whisper-small
#
# ==========================================
# RECOMMENDED MODELS
# ==========================================
#
# For LLM (choose based on your hardware):
# - Fast: mistral (7B), qwen2.5 (7B)
# - Balanced: llama3.1 (8B)
# - Best quality: qwen2.5 (14B+), llama3.1 (70B) - requires powerful GPU
#
# For Embeddings:
# - nomic-embed-text (recommended, 137M params)
# - mxbai-embed-large (334M params, better quality)
#
# For TTS:
# - speaches-ai/Kokoro-82M-v1.0-ONNX (good quality, fast)
#
# For STT (Whisper):
# - faster-whisper-small (balanced, ~500MB)
# - faster-whisper-base (faster, less accurate)
# - faster-whisper-large-v3 (best quality, slower, ~3GB)
#
# ==========================================
# HARDWARE REQUIREMENTS
# ==========================================
#
# Minimum (CPU only):
# - 8 GB RAM
# - 20 GB disk space
# - 4 CPU cores
#
# Recommended (with GPU):
# - 16+ GB RAM
# - 8+ GB VRAM (NVIDIA GPU)
# - 50 GB disk space
# - 8+ CPU cores
#
# ==========================================
# COST COMPARISON
# ==========================================
#
# Local (this setup):
# - Cost: $0 (after hardware)
# - Privacy: 100% private
# - Speed: Depends on hardware
#
# Cloud (OpenAI + ElevenLabs):
# - LLM: ~$0.01-0.10 per 1K tokens
# - Embeddings: ~$0.0001 per 1K tokens
# - TTS: ~$0.015 per minute
# - STT: ~$0.006 per minute
# - Privacy: Data sent to providers
# - Speed: Usually faster
+65
View File
@@ -0,0 +1,65 @@
# Docker Compose with Ollama (Free Local AI)
#
# This setup includes Ollama for running local AI models without API costs.
# Great for privacy-focused deployments or testing without cloud dependencies.
#
# Usage:
# 1. Copy this file to your project folder as docker-compose.yml
# 2. Change OPEN_NOTEBOOK_ENCRYPTION_KEY below
# 3. Run: docker compose up -d
# 4. Pull a model: docker exec open_notebook-ollama-1 ollama pull mistral
# 5. Configure Ollama in UI: Settings → API Keys → Add Ollama (URL: http://ollama:11434)
services:
surrealdb:
image: surrealdb/surrealdb:v2
command: start --log info --user root --pass root rocksdb:/mydata/mydatabase.db
user: root
ports:
# Localhost only — the database uses default credentials, so never
# publish this port on 0.0.0.0
- "127.0.0.1:8000:8000"
volumes:
- ./surreal_data:/mydata
environment:
- SURREAL_EXPERIMENTAL_GRAPHQL=true
restart: always
pull_policy: always
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_models:/root/.ollama
restart: always
pull_policy: always
open_notebook:
image: lfnovo/open_notebook:v1-latest
ports:
- "8502:8502"
- "5055:5055"
environment:
# REQUIRED: Change this to your own secret string
- OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string
# Database connection
- SURREAL_URL=ws://surrealdb:8000/rpc
- SURREAL_USER=root
- SURREAL_PASSWORD=root
- SURREAL_NAMESPACE=open_notebook
- SURREAL_DATABASE=open_notebook
# Ollama connection
- OLLAMA_BASE_URL=http://ollama:11434
volumes:
- ./notebook_data:/app/data
depends_on:
- surrealdb
- ollama
restart: always
pull_policy: always
volumes:
ollama_models:
+24
View File
@@ -0,0 +1,24 @@
services:
open_notebook_single:
# image: lfnovo/open_notebook:v1-latest-single
build:
context: .
dockerfile: Dockerfile
target: single
ports:
- "8502:8502" # Next.js Frontend
- "5055:5055" # REST API
env_file:
- ./docker.env
environment:
# Override for single-container mode: SurrealDB runs on localhost inside the same container
- SURREAL_URL=ws://localhost:8000/rpc
volumes:
- ./notebook_data:/app/data # Application data
- ./surreal_single_data:/mydata # SurrealDB data
restart: always
# Single container includes all services: SurrealDB, API, Worker, and Next.js Frontend
# Access:
# - Next.js UI: http://localhost:8502
# - REST API: http://localhost:5055
# - API Documentation: http://localhost:5055/docs
+127
View File
@@ -0,0 +1,127 @@
# Docker Compose with Speaches (Local TTS/STT)
#
# This setup includes Speaches for free, private speech processing:
# - Text-to-Speech (TTS): Generate podcast audio locally
# - Speech-to-Text (STT): Transcribe audio/video content locally
#
# Why Speaches?
# - Free: No per-minute/per-character costs
# - Private: Audio never leaves your machine
# - Offline: Works without internet
# - OpenAI-compatible: Drop-in replacement for OpenAI TTS/STT
#
# Usage:
# 1. Copy this file to your project folder as docker-compose.yml
# 2. Change OPEN_NOTEBOOK_ENCRYPTION_KEY below
# 3. Run: docker compose up -d
# 4. Download models (see instructions below)
# 5. Configure in UI: Settings → API Keys → Add OpenAI-Compatible
#
# Full documentation:
# - TTS setup: https://github.com/lfnovo/open-notebook/blob/main/docs/5-CONFIGURATION/local-tts.md
# - STT setup: https://github.com/lfnovo/open-notebook/blob/main/docs/5-CONFIGURATION/local-stt.md
services:
surrealdb:
image: surrealdb/surrealdb:v2
command: start --log info --user root --pass root rocksdb:/mydata/mydatabase.db
user: root
ports:
# Localhost only — the database uses default credentials, so never
# publish this port on 0.0.0.0
- "127.0.0.1:8000:8000"
volumes:
- ./surreal_data:/mydata
environment:
- SURREAL_EXPERIMENTAL_GRAPHQL=true
restart: always
pull_policy: always
speaches:
image: ghcr.io/speaches-ai/speaches:latest-cpu
container_name: speaches
ports:
- "8969:8000"
volumes:
- hf-hub-cache:/home/ubuntu/.cache/huggingface/hub
restart: unless-stopped
# For GPU acceleration, use: ghcr.io/speaches-ai/speaches:latest-cuda
# and add GPU device mapping (see docs/5-CONFIGURATION/local-tts.md)
open_notebook:
image: lfnovo/open_notebook:v1-latest
ports:
- "8502:8502"
- "5055:5055"
environment:
# REQUIRED: Change this to your own secret string
- OPEN_NOTEBOOK_ENCRYPTION_KEY=change-me-to-a-secret-string
# Database connection
- SURREAL_URL=ws://surrealdb:8000/rpc
- SURREAL_USER=root
- SURREAL_PASSWORD=root
- SURREAL_NAMESPACE=open_notebook
- SURREAL_DATABASE=open_notebook
volumes:
- ./notebook_data:/app/data
depends_on:
- surrealdb
- speaches
restart: always
pull_policy: always
volumes:
hf-hub-cache:
# ==========================================
# AFTER STARTING: Download Speech Models
# ==========================================
#
# For TTS (Text-to-Speech):
# docker compose exec speaches uv tool run speaches-cli model download speaches-ai/Kokoro-82M-v1.0-ONNX
#
# For STT (Speech-to-Text):
# docker compose exec speaches uv tool run speaches-cli model download Systran/faster-whisper-small
#
# ==========================================
# CONFIGURATION IN OPEN NOTEBOOK
# ==========================================
#
# 1. Go to Settings → API Keys
# 2. Click "Add Credential" → Select "OpenAI-Compatible"
# 3. Configure:
# - Name: "Local Speaches"
# - Base URL for TTS: http://host.docker.internal:8969/v1 (macOS/Windows)
# or: http://172.17.0.1:8969/v1 (Linux)
# - Base URL for STT: (same as TTS)
# 4. Click Save → Test Connection
#
# 5. Go to Settings → Models
# 6. Add TTS Model:
# - Provider: openai_compatible
# - Model Name: speaches-ai/Kokoro-82M-v1.0-ONNX
# - Display Name: Local TTS
#
# 7. Add STT Model:
# - Provider: openai_compatible
# - Model Name: Systran/faster-whisper-small
# - Display Name: Local Whisper
#
# ==========================================
# TESTING
# ==========================================
#
# Test TTS:
# curl "http://localhost:8969/v1/audio/speech" -s \
# -H "Content-Type: application/json" \
# --output test.mp3 \
# --data '{"input": "Hello, local TTS works!", "model": "speaches-ai/Kokoro-82M-v1.0-ONNX", "voice": "af_bella"}'
#
# Test STT:
# curl "http://localhost:8969/v1/audio/transcriptions" \
# -F "file=@test.mp3" \
# -F "model=Systran/faster-whisper-small"
#
# Available voices: af_bella, af_sarah, am_adam, am_michael, bf_emma, bm_george
# Available models: See docs/5-CONFIGURATION/local-stt.md for model sizes
+26
View File
@@ -0,0 +1,26 @@
# EasyPanel template
This directory contains an EasyPanel template for Open Notebook. It follows the
format used by the official EasyPanel templates repository:
- `meta.yaml` describes the template metadata and input schema.
- `index.ts` generates the EasyPanel services.
The template deploys two services:
- Open Notebook, exposed on port `8502`.
- SurrealDB v2, kept private on the project network and persisted in a volume.
## Testing
1. Copy this directory to `templates/open-notebook` in
`easypanel-io/templates`.
2. Run the EasyPanel templates playground with `npm run dev`.
3. Create the template from the generated JSON inside an EasyPanel instance.
Set an Open Notebook password in the form before deploying. If it is left blank,
the template generates one and stores it in the app service environment as
`OPEN_NOTEBOOK_PASSWORD`.
After deployment, open the EasyPanel domain and configure AI providers from
Open Notebook's Settings > API Keys page.
+80
View File
@@ -0,0 +1,80 @@
import {
Output,
randomPassword,
randomString,
Services,
} from "~templates-utils";
import { Input } from "./meta";
export function generate(input: Input): Output {
const services: Services = [];
const appPassword = input.appPassword || randomPassword();
const databasePassword = randomPassword();
const encryptionKey = randomString(64);
services.push({
type: "app",
data: {
serviceName: input.databaseServiceName,
env: [`SURREAL_EXPERIMENTAL_GRAPHQL=true`].join("\n"),
source: {
type: "image",
image: input.databaseServiceImage,
},
deploy: {
command: [
"start",
"--log info",
"--user root",
`--pass ${databasePassword}`,
"--bind 0.0.0.0:8000",
"rocksdb:/mydata/mydatabase.db",
].join(" "),
},
mounts: [
{
type: "volume",
name: "surreal-data",
mountPath: "/mydata",
},
],
},
});
services.push({
type: "app",
data: {
serviceName: input.appServiceName,
env: [
`API_URL=https://$(PRIMARY_DOMAIN)`,
`INTERNAL_API_URL=http://localhost:5055`,
`OPEN_NOTEBOOK_ENCRYPTION_KEY=${encryptionKey}`,
`OPEN_NOTEBOOK_PASSWORD=${appPassword}`,
`SURREAL_URL=ws://$(PROJECT_NAME)_${input.databaseServiceName}:8000/rpc`,
`SURREAL_USER=root`,
`SURREAL_PASSWORD=${databasePassword}`,
`SURREAL_NAMESPACE=open_notebook`,
`SURREAL_DATABASE=open_notebook`,
].join("\n"),
source: {
type: "image",
image: input.appServiceImage,
},
domains: [
{
host: "$(EASYPANEL_DOMAIN)",
port: 8502,
},
],
mounts: [
{
type: "volume",
name: "notebook-data",
mountPath: "/app/data",
},
],
},
});
return { services };
}
+79
View File
@@ -0,0 +1,79 @@
name: Open Notebook
description:
Open Notebook is an open-source, self-hosted notebook and research workspace
for collecting sources, taking notes, searching, chatting with content, and
generating podcasts.
instructions:
Deploy the template, open the generated EasyPanel domain, and log in with the
configured Open Notebook password. Configure AI providers from Settings > API
Keys after the first login. If the password field is left blank, a random
password is generated and stored as OPEN_NOTEBOOK_PASSWORD in the app service
environment.
changeLog:
- date: 2026-06-19
description: First release
links:
- label: Website
url: https://www.open-notebook.ai
- label: Documentation
url: https://github.com/lfnovo/open-notebook/tree/main/docs
- label: Github
url: https://github.com/lfnovo/open-notebook
contributors:
- name: nyxst4ck
url: https://github.com/nyxst4ck
schema:
type: object
required:
- appServiceName
- appServiceImage
- databaseServiceName
- databaseServiceImage
properties:
appServiceName:
type: string
title: App Service Name
default: open-notebook
appServiceImage:
type: string
title: App Service Image
default: lfnovo/open_notebook:1.10.0
databaseServiceName:
type: string
title: Database Service Name
default: surrealdb
databaseServiceImage:
type: string
title: Database Service Image
default: surrealdb/surrealdb:v2
appPassword:
type: string
title: Open Notebook Password
default: ""
benefits:
- title: One-click deployment
description:
Creates the Open Notebook app and SurrealDB database services with the
required environment variables and persistent volumes.
- title: Secure defaults
description:
Generates database and encryption secrets during template creation and
supports a user-provided or generated application password.
- title: Reverse-proxy friendly
description:
Exposes only the frontend port and uses Open Notebook's built-in Next.js
API proxy for backend requests.
features:
- title: Source collection
description: Save documents, web pages, audio, video, and other research sources.
- title: Notebook workspace
description: Organize sources and notes into reusable research notebooks.
- title: AI chat and search
description: Ask questions across notebook context with citations.
- title: Podcast generation
description: Generate podcast-style audio from selected notebook content.
tags:
- AI
- Knowledge Management
- Notes
- Research