虽然很简单, 但是还是想记录一下:
准备一台云主机并连接到云主机上
因为是 springboot 项目, 采用了前后端分离部署所以就没有使用 Tomcat 为应用程序创建文件夹
添加启动脚本 start.sh
- #!/bin/bash
- rm nohup.out
- kill -9 `ps -ef|grep app-|awk {print $2}`
- nohup java -jar -Ddev_meta=http://localhost:8801/ -Denv=DEV -Didc=app -Dfile.encoding=UTF-8 /home/it/app/app-1.0.0-SNAPSHOT.jar --logging.path=/home/it/app/log &
其中
http://localhost:8801/ -Denv=DEV -Didc=app 为 apollo 配置
把 jar 包上传
前端使用 nginx 服务
然后是端口的映射 ip 资源珍贵, 公司内部的服务都是通过一个 IP 转发, 具体的操作我不懂尴尬
来源: http://www.bubuko.com/infodetail-2541616.html