📝 docs: 添加生产环境部署指南和 MinIO CORS 配置

- 添加生产环境构建和启动说明
- 添加 PM2 进程管理配置指南
- 添加应用更新部署流程
- 配置 MinIO CORS 支持跨域访问

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
This commit is contained in:
2026-01-09 18:17:29 +08:00
co-authored by Claude Sonnet 4.5
parent 24e77e11c0
commit a5bc649f8a
2 changed files with 72 additions and 0 deletions
+71
View File
@@ -89,6 +89,7 @@ One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/
- [🧩 Plugins](#-plugins)
- [⌨️ Local Development](#️-local-development)
- [Environment Setup](#environment-setup)
- [Production Deployment](#production-deployment)
- [🤝 Contributing](#-contributing)
- [❤️ Sponsor](#️-sponsor)
- [🔗 More Products](#-more-products)
@@ -749,6 +750,76 @@ OLLAMA_PROXY_URL=http://192.168.1.x:11434
ENABLED_OLLAMA=1
```
### Production Deployment
For production deployment, build and start the optimized version:
#### Build for Production
```bash
# Build the application
pnpm build
# This will:
# - Run linting and type checking
# - Create optimized production bundles
# - Generate static pages
# - Run database migrations
```
#### Start Production Server
```bash
# Start the production server (port 3210 by default)
pnpm start
# The server will be available at:
# - Local: http://localhost:3210
# - Network: http://your-lan-ip:3210
```
#### Process Management with PM2 (Recommended)
For persistent background running and auto-restart:
```bash
# Install PM2 globally
npm install -g pm2
# Start the application
pm2 start "pnpm start" --name lobe-chat
# Enable startup on boot
pm2 startup
pm2 save
# Useful PM2 commands
pm2 status # Check status
pm2 logs lobe-chat # View logs
pm2 restart lobe-chat # Restart app
pm2 stop lobe-chat # Stop app
pm2 delete lobe-chat # Remove from PM2
```
#### Update Deployment
```bash
# Pull latest changes
git pull
# Install dependencies
pnpm install
# Rebuild
pnpm build
# Restart (if using PM2)
pm2 restart lobe-chat
# Or restart manually
pkill -f "next start" && pnpm start
```
If you would like to learn more details, please feel free to look at our [📘 Development Guide][docs-dev-guide].
<div align="right">
+1
View File
@@ -10,6 +10,7 @@ services:
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
- MINIO_API_CORS_ALLOW_ORIGIN=*
volumes:
- ./minio-data:/data
command: server /data --console-address ":9001"