This is an example of full Play Framework server deployment with Activator generated sample application for Qt Cloud Services - Managed Application Runtime ("MAR"). More information about Play Framework.
See the Managed Application Runtime getting started documentation at Qt Cloud Services Developer Documentation
This project demonstrates also using a composable multi-buildpack feature using Heroku buildpack for Scala. After creating MAR instance the respective environmental variable must be set in MAR container for enabling the multi-buildpack support. Take a look on notes in chapter "Deploying to Cloud".
Procfile instructs the web process type to run the java.sh file which containts the detailed information how to startup the application.
Upon deployment Qt Cloud Services MAR container provides an environmental variable $PORT for which the HTTPS requests hitting Qt Cloud Services load balancer SSL port are internally forwarded into.
The $PORT value is delivered to the Play Framework process by this script file when executed by a web process in MAR container.
This file contains only the dependency information about Play Framework version to be used (Play Framework 2.3).
You can start this application from the application root directory with the following commands depending your operating system:
./activator run
activator.bat run
Once the server has been started, you may test the sample application with your web browser at address http://127.0.0.1:9000 which should respond with "Your new application is ready!" decorated with Play Framework welcome page which is shown only when running locally in development mode.
Please see the Qt Cloud Services Developer Documentation
NOTE: This example requires multi-buildpack support to be instructed for MAR container before deploying the sample into it. Using qtc-cli client command-line tool run the following command into MAR in question:
qtc-cli mar envs:set BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi
NOTE: Without tweaking any command-line Java arguments regarding the heap memory usage deploy the sample app only to the instance which fulfills the following Runtime Size: ar-1-small (2CU, 512MB)
Once having the application deployed and running in the cloud, you may test the sample application with your web browser at address https://.qtcloudapp.com/hello-world-webapp which should respond with a bare string "Your new application is ready.".