Database Reference
In-Depth Information
Deploying your applications
The first item you need to understand is how the deploy process happens. An application is
a collection of code with its associated dependencies. In the case of Ruby on Rails, these
dependencies are found in Gemfile in Python requirements.txt , in Node.js
package.json , and in Java pom.xml . This gives further information on how Heroku
should work with your code.
If you use Ruby, Node.js, Python, or Java, Heroku can easily identify how to make your
code executable, through the conventions that these languages adopt. For example, in the
case of Ruby on Rails, Heroku knows it needs to run the Rails server to run your applica-
tion.
If Heroku cannot run your application, you need to show how to do it. You must do so
through the creation of a Procfile in your project, which contains instructions on how to
run your application, as follows:
web: java -jar lib/my_app.jar $PORT
Tip
Downloading the example code
You can download the example code files from your account at http://www.packtpub.com
for all the Packt Publishing topics you have purchased. If you purchased this topic else-
where, you can visit http://www.packtpub.com/support and register to have the files e-
mailed directly to you.
Heroku has adopted a very simple way to send your code to deploy. Each application built
on Heroku has a Git repository, you should do a git push heroku master to start
the deploy process. In the next chapter, you will deploy your first application and under-
stand it better.
Heroku handles your code and dependencies by generating an optimized slug of your ap-
plication. This slug is placed in each dyno that you have and each slug contains a com-
pressed copy of your application. The slug is created by the slug compiler and its core is a
collection of scripts called a buildpack. For each language supported by Heroku, there is
one buildpack available. You can find more information about each of them in their reposit-
ories on GitHub:
Search WWH ::




Custom Search