Files
vox/README.md

75 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Vox (词脉)
智能单词挑战系统。
- **极速**Svelte 5 + Tailwind 4
- **智能**:错题本 + 专项练习
- **持久**SQLite 存储
```bash
npm i && npm run dev # Port: 1995
```
## Docker
### 1. 使用 Docker CLI
```bash
# 关键:先在本地创建一个空文件,防止 Docker 将其识别为文件夹
touch data.db
docker build -t vox-app .
docker run -p 1995:1995 -v $(pwd)/data.db:/app/data.db vox-app
```
### 2. 使用 Docker Compose (推荐)
已配置为直接拉取注册表镜像并映射至端口 **19953**
```bash
# 启动
docker-compose up -d
# 停止
docker-compose down
# 查看实时日志
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
```
### 4. 发布与分发 (镜像分发模式)
如果您想让其他用户像下载标准镜像一样直接使用:
```bash
# 1. 首先登录您的 Gitea 注册表 (仅需一次)
docker login gitea.qxy1828.com
# 2. 运行发布脚本(执行本地编译 + 镜像打包)
./release.sh
# 2. 推送到您的 Gitea 注册表
docker push gitea.qxy1828.com/chaos/vox:latest
```
## 推送到 GitHub
如果您想将代码推送到 GitHub
```bash
# 1. 在 GitHub 上创建一个新仓库
# 2. 添加 GitHub 远端
git remote add github https://github.com/您的用户名/仓库名.git
# 3. 推送代码
git push -u github main
```
用户端只需:
```bash
docker pull gitea.qxy1828.com/chaos/vox:latest
docker run -p 1995:1995 -v /path/to/data.db:/app/data.db gitea.qxy1828.com/chaos/vox:latest
```