What is a Procfile-based application
Asked Answered
Y

2

9

I have seen enough of its appearance that I have to understand more about it. I see that Heroku has a procfile and I assume it's about running this procfile after it deployed to heroku.

I also see the term procfiled-based application. So actually is Procfile specific to Heroku or is it something else?

Yenta answered 13/4, 2015 at 16:36 Comment(0)
C
8

Procfile and the Foreman Gem

A Procfile is used by the foreman gem to run services with a user-defined name and options. Heroku uses it to configure services to run in the dyno, but it can be used by anyone who is willing to invoke things with foreman start <named_process> instead of however they were doing it before.

Example

I often use it in development to choose between unicorn and thin for my Rails server. For example:

thin: bundle exec thin start -e development -p 8080
unicorn: bundle exec unicorn -c config/unicorn.vagrant.rb

With this configuration, I can start thin with foreman start thin or unicorn with foreman start unicorn. Your mileage, and the usefulness of the gem, will certainly vary.

Choir answered 13/4, 2015 at 16:50 Comment(0)
S
1

Regarding Heroku, here is a link that gives an explanation of the contents of a Procfile.

Essentially, it's a file included in your root directory that tells Heroku what command should be executed to start your application. In the linked example, the line tells heroku that you will be running a web stack and that you are going to launch a node.js server titled index.js. Once the node server is launched it is responsible for responding to and handling HTML requests.

Straitjacket answered 13/4, 2015 at 16:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.