Add pre-compiled deployment support (Dockerfile.fast) and optimized build process

This commit is contained in:
chaos
2026-03-17 00:20:59 +08:00
parent 52b4f43f45
commit 04ed3fb67a
2 changed files with 42 additions and 0 deletions

View File

@@ -24,3 +24,17 @@ docker-compose up -d
# 查看日志
docker-compose logs -f
```
### 3. 先编译后打包 (推荐:适用于性能较弱的服务器)
在本地预先编译,仅将结果推送到容器,可极大地减少部署时间。
```bash
# 1. 本地编译
npm install
npm run build
# 2. 使用精简版 Dockerfile 构建
docker build -t vox-fast -f Dockerfile.fast .
# 3. 运行
docker run -p 1995:1995 -v $(pwd)/data.db:/app/data.db vox-fast
```