Scala Play Framework Web Application Hosting Process

I work in a web project using scala and play framework. I am worried about the application deployment part. I need to host my application on a Glass fish server. So who has the experience? I have experience hosting javaEE applications to upload a .war file to a server. but how can I host a gaming application? I refer to the following article and build dist. Production dist

If someone can give me instructions step by step, this is easy for me to understand. Thanks

+1
source share
1 answer

Recommended way to start the game! application in production - run it offline, and not in the application server environment. There are plugins that can create a * .war file for you, however, if you prefer to go ahead. In particular, take a look at this: https://github.com/play2war/play2-war-plugin

I would suggest that you do the recommended offline deployment. We have good experience with the sbt-native-packager SBT plugin. It can create deb and rpm files with support for System V or Upstart startup scripts. Additional information about Play! Production Page .

To use sbt-native-packager , you first need to add it to your project/plugins.sbt file. Similarly: addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.0-RC2") .

Then in build.sbt you will need to configure the necessary properties of the package, as described on the Production page above. I will copy part of the configuration from this page here. Let's say you use the rpm format for deployment on CentOS. Here is what you need to put in build.sbt :

 lazy val root = (project in file(".")) .enablePlugins(PlayScala, RpmPlugin) maintainer in Linux := "First Lastname < first.last@example.com >" packageSummary in Linux := "My custom package summary" packageDescription := "My longer package description" rpmRelease := "1" rpmVendor := "example.com" rpmUrl := Some("http://github.com/example/server") rpmLicense := Some("Apache v2") 

Then run sbt from the command line and run the following command: rpm:packageBin . It will create your application and create the rpm file, which will be placed and named like this: ./target/rpm/RPMS/noarch/your-application-name.noarch.rpm .

From there it is standard rpm , which you can deploy and run as usual.

+5
source

Source: https://habr.com/ru/post/1245020/


All Articles