How do I run a spring boot executable jar in a Production environment?

后端 未结 9 2129
一向
一向 2020-12-02 04:19

Spring boot\'s preferred deployment method is via a executable jar file which contains tomcat inside.

It is started with a simple java -jar myapp.jar.

9条回答
  •  -上瘾入骨i
    2020-12-02 05:09

    You can use the application called Supervisor. In supervisor config you can define multiple services and ways to execute the same.

    For Java and Spring boot applications the command would be java -jar springbootapp.jar.

    Options can be provided to keep the application running always.So if the EC2 restart then Supervisor will restart you application

    I found Supervisor easy to use compared to putting startup scripts in /etc/init.d/.The startup scripts would hang or go into waiting state in case of errors .

提交回复
热议问题