fix: agent install.sh 404 + 三阶段构建编译agent二进制

问题: 构建上下文 ./backend 无法访问 ../agent, 导致容器内
/app/agent/deploy/install.sh 不存在, 返回 404

修复:
- Dockerfile 改为三阶段构建 (backend go1.21 + agent go1.24 交叉编译 + alpine runtime)
- docker-compose backend build context 改为项目根
- routes.go /agent/arch 安装命令改为动态获取 URL
- 新增 .dockerignore
- agent_install.go: SSH 远程安装 handler
- AgentWizard.tsx: 复制按钮 fallback + 动态 server URL
- ServerTableRow.tsx: agent 状态判断

验证: curl|bash 安装成功, agent 上报数据到 MySQL ✅
This commit is contained in:
Logan committed 2026-06-18 09:44:12 +08:00
1 parent d0344c2f52
commit d0b94d39c0
9 files changed
+281 -38

No files matched your search

+8
View File
@@ -48,6 +48,14 @@ server {
proxy_read_timeout 86400;
}
# Agent 安装脚本和二进制文件代理 → 后端
location /agent/ {
proxy_pass http://backend:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 健康检查代理
location /health {
proxy_pass http://backend:8080;