Configuring the WSGI server with a Procfile - AWS Elastic Beanstalk

Configuring the WSGI server with a Procfile

You can add a Procfile to your source bundle to specify and configure the WSGI server for your application. The following example uses a Procfile to specify uWSGI as the server and configure it.

Example Procfile
web: uwsgi --http :8000 --wsgi-file application.py --master --processes 4 --threads 2

The following example uses a Procfile to configure Gunicorn, the default WSGI server.

Example Procfile
web: gunicorn --bind :8000 --workers 3 --threads 2 project.wsgi:application
Notes
  • If you configure any WSGI server other than Gunicorn, be sure to also specify it as a dependency of your application, so that it is installed on your environment instances. For details about dependency specification, see Specifying dependencies using a requirements file.

  • The default port for the WSGI server is 8000. If you specify a different port number in your Procfile command, set the PORT environment property to this port number too.

When you use a Procfile, it overrides aws:elasticbeanstalk:container:python namespace options that you set using configuration files.

For details about Procfile usage, expand the Buildfile and Procfile section in Extending Elastic Beanstalk Linux platforms.