简体   繁体   中英

Scala application on CF

I tried to launch our Scala application on the Swisscom Cloud Foundry (CF) infrastructure. To do so, the matching Heroku buildpack was used:

https://github.com/heroku/heroku-buildpack-scala

As this did not work, I tried to deploy the 'hello-scala' example using this buildpack. My fork to be able to build the slightly outdated example:

https://github.com/AlwinEgger/hello-scala

I have to underline that I am fetching the port I have to use as env variable 'PORT'.

Unfortunately, there is not much on the log. "failed to accept connections within health check timeout" message indicates that there is no one listening...

My questions: Did anyone succeed in deploying Scala apps on CF infrastructures (@ Swisscom)?

A workaround I found:

I'm not using the scala- but the java-buildback. This with the major advantage and inconvenience that the project is not any more build on the instance.

  • Advantage: It speeds up the whole process considerably
  • Inconvenience: A build server is needed

So what do we have to do?

An example may be found here (this is the actual application): https://github.com/OpenOlitor/openolitor-server

  1. Add the sbt-native-packager to your project
  2. Execute the action 'universal:packageBin' building by hand or configure your build server to do so
  3. Change the buildpack in the manifest.yml and add some parameters, if necessary. Configure the path of the artifact to deploy.
  4. Run cf push or let the build server do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM