summaryrefslogtreecommitdiff
path: root/templates/gunicorn.erb
blob: 1a965315f9deb0d52c52b1ff0dd5a9c3e276d3bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
CONFIG = {
<% if mode == 'django' -%>
  'mode': 'django',
<% else -%>
  'mode': 'wsgi',
<% end -%>
<% if virtualenv -%>
  'environment': {
<% if environment -%>
    'ENVIRONMENT': '<%= environment %>',
<% end -%>
    'PYTHONPATH': '<%= virtualenv %>'
  },
<% end -%>
  'working_dir': '<%= dir %>',
  'user': 'www-data',
  'group': 'www-data',
<% if virtualenv -%>
  'python': '<%= virtualenv %>/bin/python',
<% else -%>
  'python': '/usr/bin/python',
<% end -%>
  'args': (
<% if !virtualenv and !bind -%>
    '--bind=unix:/tmp/gunicorn-<%= name %>.socket',
<% elsif virtualenv and !bind -%>
    '--bind=unix:<%= virtualenv %>/<%= name %>.socket',
<% else -%>
    '--bind=<%= bind %>',
<% end -%>
    '--workers=<%= @processorcount.to_i*2 %>',
    '--timeout=30',
<% if mode != 'django' -%>
    'app:app',
<% end -%>
  ),
}