推荐一个快速部署Java,NodeJS,Python,Scala,.NET等Web应用程序平台

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chancein007/article/details/86662677

最近在Github上发现了一款神器,由Daniel Flower开发并开源的一款产品 App Runner,其Github的地址如下:https://github.com/danielflower/app-runner

我们可以把其看成是一个可以快速部署自己应用小的Web应用程序的私有云的PAAS平台,其支持Java, Clojure, NodeJS, Python, golang, Scala 和.NET 。 一旦这个平台跑起来了之后,只要告诉其Git地址,就能自动把部署的应用程序拉起来,如果部署在Git服务器上的应用程序有自动更新,其还会自动部署,功能强大到爆。

下面看看其运行以后的界面的样子吧。
在这里插入图片描述
那么如何把这个平台启动起来呢? 其实很简单,通过下面几步就可以了。

  1. 到Github上把代码下载下来
  2. 安装好JAVA,推荐JDK8.
  3. 配置好你的Maven环境,特别是Maven home的环境变量,而且maven Home的环境变量的名字必须为M2_HOME,否则就部署不了Maven的Java项目配置好你的Maven环境,特别是Maven home的环境变量,而且maven Home的环境变量的名字必须为M2_HOME,否则就部署不了Maven的Java项目
  4. 在AppRunner代码根目录下,指定配置文件
# The port that users will use to access the apps
appserver.port=8000

# A directory where all the repos, log files, temp data etc will be stored
appserver.data.dir=data

# Specifies an app to download and run if there are no apps already. The default app is a console
# that lets you view and add apps.
appserver.initial.app.url=https://github.com/danielflower/app-runner-home.git

# You can redirect "/" to an app - e.g. one that lists all the available apps
appserver.default.app.name=app-runner-home

# To support https, you need to specify an https port, and you need to have a keystore
#appserver.https.port=8443
#apprunner.keystore.type=JKS
#apprunner.keystore.path=test.keystore
#apprunner.keystore.password=password
#apprunner.keymanager.password=password

# Timeouts in millis for the proxied requests to the apps - if an app exceeds these when responding a 504 is returned
apprunner.proxy.total.timeout=60000
apprunner.proxy.idle.timeout=30000

需要注意的是,其默认配置文件https是打开的,如果在测试环境不想AppRunner的PAAS平台不允许在HTTPS的环境下,可以把下面的参数注释掉。

#appserver.https.port=8443
#apprunner.keystore.type=JKS
#apprunner.keystore.path=test.keystore
#apprunner.keystore.password=password
#apprunner.keymanager.password=password
  1. 通过下面的Maven命令编译后,就会生成一个jar文件
mvn  clean package
  1. 在根目录下有一个local的文件夹,指定其配置文件,如果是Windows的操作系统
    就直接允许start.bat ,如果是Linux系统,直接允许start.sh

注意当前的最新代码,其start.bat或者start.sh会默认使用下面的命令启动

@echo off
java -Dlogback.configurationFile=logback.xml -agentlib:jdwp=transport=dt_socket,server=y,
suspend=n,address=1044 -jar ..\target\app-runner-1.0-SNAPSHOT.jar config.properties

但是源代码生成的名称是app-runner-2.0-SNAPSHOT.jar

为了保持一致,请把默认的start.bat里面的jar包的名字改成app-runner-2.0-SNAPSHOT.jar 。

大家如果感兴趣的话,可以快速试一下。Enjoy it~~~~~~

猜你喜欢

转载自blog.csdn.net/chancein007/article/details/86662677