Skip to content

Procfile

Overview

Procfile is a simple text file that describes the components required to run an application. It is the way to tell tsuru how to run your applications.

Syntax

A Procfile is a plain text file named Procfile placed at the root of your application. Each process should be represented by a name and a command:

<name>: <command>
  • name: letters, digits, _ and - (tsuru parses each line with ^([A-Za-z0-9_-]+):\s*(.+)$). Because the name becomes part of Kubernetes object names, use lowercase in practice.
  • command: A shell command line which will be executed to spawn a process. Lines that do not match the pattern are ignored.

If there is no Procfile and tsuru.yaml declares no process command, tsuru creates a single web process from the image ENTRYPOINT and CMD.

tsuru.yaml takes precedence

A processes: list in tsuru.yaml overrides Procfile entries with the same name. Use it when a process also needs its own healthcheck, startupcheck or ports.

Example

web: gunicorn -w 3 wsgi

The web process is special in tsuru - it is responsible for receiving HTTP requests. Your web process must listen on the port specified by the PORT environment variable, or use the default port 8888.

Multiple processes

You can define multiple processes in a single Procfile:

web: gunicorn -w 3 wsgi
worker: python worker.py
scheduler: python scheduler.py

Environment variables

You can reference your environment variables in the command:

web: ./manage.py runserver 0.0.0.0:$PORT

Further reading

For more information about Procfiles, see the honcho documentation.