Files
sub-router/.claude/commands/deploy.md
2026-03-31 14:59:17 +08:00

22 lines
780 B
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.

将本地代码部署到远程服务器。
## 部署信息
- 服务器: ubuntu@118.195.187.179(本地私钥鉴权)
- 远程路径: /opt/1panel/apps/sub-router
- 部署方式: Docker Compose需要 sudo
## 步骤
1. 找出本地相对于远程的改动文件(对比 git diff 或根据上下文判断)
2. 将改动文件通过 scp 上传到远程 /tmp
3. 通过 ssh + sudo cp 复制到 /opt/1panel/apps/sub-router 对应路径
4. 执行 `sudo docker compose up -d --build` 重建并重启容器
5. 检查 `sudo docker logs` 确认服务正常启动
## 注意事项
- 远程目录需要 sudo 权限写入,所以先传 /tmp 再 cp
- 如果只改了 server 代码没改前端Docker 会利用缓存加速构建
- 部署完成后务必检查日志确认无报错