Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching an app in heroku? What is procfile? 'web:' command?

I was referring to this site as i am learning python/flask and trying to use heroku.

http://ryaneshea.com/lightweight-python-apps-with-flask-twitter-bootstrap-and-heroku

Let me explain what all I did, so that any one who is stuck like me can get the picture. I am using Linux Backtrack command line . 1. I started virtualenv and then installed flask virtualenv --distribute pip install flask

Then, connected heroku and github, created a repo also in the github. Wrote a simple script and saved it in app.py

Then, asked to create a procfile! web: python app.py

Questions. 1. What is procfile in layman terms? 2. When i type web: python app.py, it says 'web:: command not found'

Please elaborate how this works?

I have one more doubt, sudo is supreme user right? We are not supposed to use it in virtualenv? And for what exactly are we using virtualenv? A simple example.

Questions are pretty basic. DO bare.

like image 815
druuu Avatar asked Sep 07 '13 05:09

druuu


People also ask

What is Procfile for Heroku?

Heroku apps include a Procfile that specifies the commands that are executed by the app on startup. You can use a Procfile to declare a variety of process types, including: Your app's web server. Multiple types of worker processes. A singleton process, such as a clock.

What does Procfile mean?

A Procfile is a mechanism for declaring what commands are run by your application's containers on the Deis platform. It follows the process model. You can use a Procfile to declare various process types, such as multiple types of workers, a singleton process like a clock, or a consumer of the Twitter streaming API.

What is Procfile application?

A Procfile is a mechanism for declaring what commands are run by your application's dynos (or a web process) on the Heroku platform. You can use a Procfile to declare various process types, such as. a web dyno to run your web application.


1 Answers

the Procfile tells Heroku what commands should be run (https://devcenter.heroku.com/articles/procfile).

You are able to define difference process types, such as web (the only one which will autostart by default), workers, etc...

So basically a Procfile containing

web: python app.py

is telling Heroku to started a named process called web, and to run python app.py when it starts.

There is Python specific documentation for Heroku at https://devcenter.heroku.com/articles/getting-started-with-python#declare-process-types-with-procfile

like image 146
John Beynon Avatar answered Oct 07 '22 22:10

John Beynon