Files
aiotagro-new/DEPLOYMENT.md
mapleaf 80bc86d703
Some checks failed
aagro-ui-admin CI / build (14.x) (push) Has been cancelled
aagro-ui-admin CI / build (16.x) (push) Has been cancelled
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
Initial commit with remote deployment configuration
2025-10-04 18:08:05 +08:00

1.8 KiB
Raw Permalink Blame History

项目部署指南

数据库和Redis配置

项目已经配置好连接到指定的数据库和Redis服务器

数据库配置

  • 地址111.3.47.177:13306
  • 用户名root
  • 密码aiotagro
  • 数据库名aiotmini

Redis配置

  • 地址111.3.47.177:16379
  • 密码aiotagro

这些配置已经在 aagro-server/src/main/resources/application-custom.yaml 文件中完成配置,并通过 aagro-server/src/main/resources/application.yaml 激活。

部署到远程服务器

部署配置说明

  • 远程服务器地址: 192.168.0.95
  • SSH 用户名: root
  • SSH 密码: aiotagro
  • 远程目录: /data/java/aiotmini
  • 应用端口: 48080

Linux/Mac 环境部署

使用脚本 script/deploy-to-remote.sh 进行部署:

# 给脚本添加执行权限
chmod +x script/deploy-to-remote.sh

# 运行部署脚本
./script/deploy-to-remote.sh

Windows 环境部署

使用脚本 script/deploy-to-remote.bat 进行部署:

注意: Windows 环境下需要安装以下工具:

  1. Maven: 用于构建项目
  2. PuTTY: 用于SSH连接和文件传输 (需要包含 plink 和 pscp 工具)

运行部署脚本:

script\deploy-to-remote.bat

部署步骤详解

  1. 构建项目:

    • 使用 Maven 清理并打包项目: mvn clean package -Dmaven.test.skip=true
  2. 传输文件到远程服务器:

    • 将构建好的 jar 文件传输到远程服务器
    • 将 Dockerfile 传输到远程服务器
  3. 在远程服务器上运行:

    • 构建 Docker 镜像
    • 运行 Docker 容器

部署完成后,可以通过 http://192.168.0.95:48080 访问应用。