Files
xiaoxia-saas/infra/docker/DEPLOYMENT.md
T

36 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.
# 部署说明
## 原则
- 服务器优先,避免本地完整环境依赖
- 前端使用生产构建:`next build` + `next start`
- 不在容器启动时执行 `npm install`
- 统一通过仓库内脚本部署,避免临时长命令
## Staging
服务器目录:`/var/lib/xiaoxia-saas-staging`
要求:
- 存在 `/var/lib/xiaoxia-saas-staging/.env`
- 服务器已安装 Docker / Docker Compose
- `3000` 被 Gitea 占用时,前端默认使用 `3001`
执行:
- CI 推送 `main` 时执行 `.gitea/workflows/deploy.yml`
- 或服务器本机执行:`/var/lib/xiaoxia-saas-staging/repo/infra/docker/deploy-staging.sh`
## Production
服务器目录:`/var/lib/xiaoxia-saas-production`
执行:
- 打 tag 后执行 `.gitea/workflows/deploy.yml`
- 或服务器本机执行:`/var/lib/xiaoxia-saas-production/repo/infra/docker/deploy-production.sh`
## 服务端口
- Web: `3001`(默认,避开 Gitea 3000
- API: `8000`
- Postgres: `5432`
- Redis: `6379`
## 说明
如果远程 SSH 链路不稳定,不直接手工拼长命令;优先让 CI 或服务器本机脚本执行。