web: python manage-dev.py runserver $DJANGO_PORT compass: compass watch pygraz_website/static
This is, for instance, the Procfile I have for the PyGRAZ.org website. It defines a web-process that represents the development server of Django and compass for updating the site’s css if necessary.
Once this configuration is in place, simply execute
foreman start and lean back as your processes start up and print their output into a single terminal.
For very simple setups that’s about it. If your processes need to be started from within a specific folder or require some other kind of hand-holding I’d advice that you create some small wrapper scripts to do that. At least, I had some problems with getting the whole environment set up within the definition itself so I put that whole process into a simple shell-script. It kind of goes against having your Procfile as part of the project’s documentation but then you could just add your shell-scripts to the project as well :-)
Another minor issue is that some environments tend to buffer output instead of just passing it right through to stdout. There is a wiki page for that.
Foreman also supports exporting of Procfile definitions to (among others) upstart and bluepill. There even is an exporter for supervisord I intend to give a shot in the future :-) Right now, though, I’m running slightly different processes in development compared to my production-environments. A good example here is the Django devserver but also the
compass watch process which locally runs without compression in order to facilitate debugging. Perhaps I can unify these to environments in the future or at least make them completely configuration dependent. That’s usually what the “.env” file is for in the same directory as the Procfile. Here you can set environment variables that are available within the Procfile.
Cleaning up my Procfile might also be helpful if I ever decide to put some of these websites onto Heroku ;-)