Deploying the Play 2.0 application on Heroku

We are working on a project using Play freamework with Scala programming language. Here we’ll discuss about the deployment of the play application on Heroku. This is a very straightforward process. You just have need to follow some simple steps and your application will be on Heroku in minutes.

1. Heroku needs a file named ‘Procfile‘ for each application to be deployed on it. Procfile is a mechanism for declaring what commands are run when your web or worker dynos are run on the Heroku platform. Find more about Procfile here. Create a file Procfile and put it in the root of your project directory.

2. Add the following line to your Procfile that you had just created:

web: target/start -Dhttp.port=$PORT -DapplyEvolutions.default=true

3.Now Initiate the git session for your project and add files to git as

git init
git add .

4. Commit the changes for the project to git as:

git commit -m init

5. On the command line create a new application using the “cedar” stack:

heroku create -s cedar

Celedon Cedar is Heroku’s most recent runtime stack.

6.The application is ready to be deployed to the cloud. push the project files to heroku as:

git push heroku master

7. Go to your heroku account -> MyApps and you’ll find a new application that you had just created. Launch the URL and have a look to your running application on heroku. You can also rename your application as well.

Heroku Applications

About Neelkanth Sachdeva

Project Manager @ eCIFM Solutions Inc. Previous : Senior Software Engineer @ Evernym Inc. Previous : Software Consultant @ Knoldus Software LLP Software Consultant @ Inphina Technologies
This entry was posted in Cloud, Scala, Web and tagged , , . Bookmark the permalink.

One Response to Deploying the Play 2.0 application on Heroku

  1. alper says:

    Where do you configure the $PORT value?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s