Files
XH-XunKe/docs/DEPLOYMENT.md
T

25 lines
1.1 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.
# 部署
复制 `.env.example` 为 `.env`,替换管理员密码、`JWT_SECRET`、`APP_ENCRYPTION_KEY`、LiveKit 和 MinIO 密钥。确认无误后再把 `APP_PROD_GUARD=true`。
```powershell
docker compose --env-file .env up --build
```
本机 8088 已被其他项目占用,Compose 把网站映射到 `18088`。官方 `minio/minio` 已不能匿名拉取,这里使用仍可拉取的 `alpine/minio:RELEASE.2025-10-15T17-29-55Z`。LiveKit 使用 `livekit/livekit-server:v1.13.11` 和 `livekit/egress:v1.13.0`。后端运行镜像是本机已有的 `eclipse-temurin:21-jdk-jammy`。
- 网站:`http://localhost:18088`
- 后端:`http://localhost:8080`
- MinIO 控制台:`http://localhost:9001`
- LiveKit:`ws://localhost:7880`,UDP `50000-50100`
校内部署时,把 `deploy/livekit.yaml` 的 `rtc.node_ip` 设成教师和学生浏览器都能访问的地址。跨 NAT 需要单独的 TURN,不能假设 HTTPS 足够。
数据库备份:
```powershell
docker compose exec postgres pg_dump -U xuenke xuenke > backup.sql
```
录像保留天数来自学校设置,过期任务每天 02:30 清理。