docs: improve offline deployment guide with docker compose (#191)

This commit is contained in:
Dayuan Jiang
2025-12-10 09:40:48 +09:00
committed by GitHub
parent 5da4ef67ec
commit 9d4c89ec43
5 changed files with 21 additions and 33 deletions

View File

@@ -114,7 +114,7 @@ docker run -d -p 3000:3000 \
ghcr.io/dayuanjiang/next-ai-draw-io:latest
```
或者使用 env 文件(从 `env.example` 创建)
或者使用 env 文件:
```bash
cp env.example .env

View File

@@ -114,7 +114,7 @@ docker run -d -p 3000:3000 \
ghcr.io/dayuanjiang/next-ai-draw-io:latest
```
または env ファイルを使用`env.example` から作成)
または env ファイルを使用:
```bash
cp env.example .env

View File

@@ -13,27 +13,7 @@ By default, Next AI Draw.io uses `embed.diagrams.net` for the diagram editor. Fo
## Quick Start
### 1. Run Local Draw.io
```bash
docker run -d -p 8080:8080 jgraph/drawio:latest
```
### 2. Build Next AI Draw.io
```bash
docker build --build-arg NEXT_PUBLIC_DRAWIO_BASE_URL=http://localhost:8080 -t next-ai-draw-io .
```
### 3. Run the Application
```bash
docker run -d -p 3000:3000 --env-file .env next-ai-draw-io
```
## Docker Compose
For a complete offline setup with both services:
Create a `docker-compose.yml`:
```yaml
services:
@@ -51,25 +31,33 @@ services:
- "3000:3000"
env_file:
- .env
depends_on:
- drawio
```
Then run:
```bash
docker compose up -d
```
## Local Development
For local development, add to your `.env.local`:
1. Start a local draw.io instance:
```bash
docker run -d -p 8080:8080 jgraph/drawio:latest
```
2. Add to your `.env.local`:
```bash
NEXT_PUBLIC_DRAWIO_BASE_URL=http://localhost:8080
```
Then rebuild the application:
3. Rebuild and run:
```bash
npm run build
npm run start
```
## Notes
- The default draw.io URL is `https://embed.diagrams.net`
- Changes to `NEXT_PUBLIC_DRAWIO_BASE_URL` require rebuilding (it's baked into the Next.js bundle at build time)
- You still need network access to your AI provider (OpenAI, Anthropic, etc.) unless using a local model like Ollama