diff --git a/salt/pillar/dev.sls b/salt/pillar/dev.sls index d756afd..6447f76 100644 --- a/salt/pillar/dev.sls +++ b/salt/pillar/dev.sls @@ -1,3 +1,4 @@ +gunicorn_args: --reload ini_file: development.ini ssl_cert_path: /etc/pki/tls/certs/localhost.crt ssl_private_key_path: /etc/pki/tls/certs/localhost.key diff --git a/salt/pillar/prod.sls b/salt/pillar/prod.sls index 3a3a417..76cd5e6 100644 --- a/salt/pillar/prod.sls +++ b/salt/pillar/prod.sls @@ -1,3 +1,4 @@ +gunicorn_args: --workers 8 ini_file: production.ini ssl_cert_path: /etc/letsencrypt/live/tildes.net/fullchain.pem ssl_private_key_path: /etc/letsencrypt/live/tildes.net/privkey.pem diff --git a/salt/salt/gunicorn/gunicorn.service.jinja2 b/salt/salt/gunicorn/gunicorn.service.jinja2 index b5ee0d6..3fd06f5 100644 --- a/salt/salt/gunicorn/gunicorn.service.jinja2 +++ b/salt/salt/gunicorn/gunicorn.service.jinja2 @@ -10,7 +10,7 @@ User={{ app_username }} Group={{ app_username }} RuntimeDirectory=gunicorn WorkingDirectory={{ app_dir }} -ExecStart={{ bin_dir }}/gunicorn --paste {{ pillar['ini_file'] }} --config {{ app_dir }}/gunicorn_config.py +ExecStart={{ bin_dir }}/gunicorn --paste {{ pillar['ini_file'] }} --config {{ app_dir }}/gunicorn_config.py --bind unix:/run/gunicorn/socket --pid /run/gunicorn/pid {{ pillar['gunicorn_args'] }} ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true diff --git a/tildes/development.ini b/tildes/development.ini index 03cae9b..bd98b21 100644 --- a/tildes/development.ini +++ b/tildes/development.ini @@ -43,10 +43,3 @@ webassets.base_dir = %(here)s/static webassets.base_url = / webassets.cache = false webassets.manifest = json - -[server:main] -use = egg:gunicorn#main -bind = unix:/run/gunicorn/socket -workers = 1 -pidfile = /run/gunicorn/pid -reload = true diff --git a/tildes/production.ini.example b/tildes/production.ini.example index b4e5923..84b58b4 100644 --- a/tildes/production.ini.example +++ b/tildes/production.ini.example @@ -39,9 +39,3 @@ api_keys.embedly = embedlykeygoeshere api_keys.stripe.publishable = pk_live_ActualKeyShouldGoHere api_keys.stripe.secret = sk_live_ActualKeyShouldGoHere api_keys.youtube = youtubekeygoeshere - -[server:main] -use = egg:gunicorn#main -bind = unix:/run/gunicorn/socket -workers = 8 -pidfile = /run/gunicorn/pid