CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.
Deployment Guide
Chinese version: README.zh-CN.md
CanvasAnvil deploys as a single web service: one Node process serves the static assets and /api/*.
Quick Start
| Scenario | Recommended | Command |
|---|---|---|
| Run directly on host | Host deployment | npm ci && npm run build && npm start |
| Containerized deployment | Docker Compose (recommended) | docker compose -f deploy/docker/docker-compose.yml up -d --build |
Default Docker endpoint:
- Main app:
http://localhost:8001/
Directory Layout
deploy/host/: host or bare-metal scripts and Nginx reverse proxy configdeploy/docker/: Dockerfiles, Nginx config, and Docker Compose config
Host Deployment
- Build
- Linux/macOS:
bash deploy/host/build.sh
- Windows PowerShell:
powershell -ExecutionPolicy Bypass -File deploy/host/build.ps1
- Or run manually:
npm ci
npm run build
- Run
npm start
For production, use pm2 or systemd to keep the service alive.
The main app listens on PORT, defaulting to 8080. To use port 8001 directly on the host:
PORT=8001 npm start
- Nginx (optional)
- Enable
deploy/host/nginx.confand reload Nginx - Includes
client_max_body_size 25m - Sets
proxy_buffering offfor/api/chat - Proxies
/healthz
Docker Deployment
Option A: Docker Compose
docker compose -f deploy/docker/docker-compose.yml up -d --build
The Compose file starts the app service:
services:
app:
ports:
- "8001:8080"
Keep PORT=8080 inside the main app container unless you specifically need to change the container's internal listen port.
Option B: Docker CLI
docker build -f deploy/docker/Dockerfile -t canvasanvil/app:latest .
docker run --rm -p 8001:8080 canvasanvil/app:latest
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
8080 |
Service listen port inside the container or host process |
API_BODY_LIMIT |
25mb |
Maximum API request body size |
WEB_DIST_DIR |
./dist |
Static web assets directory |