mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 06:37:15 +00:00
Adds gunicorn to run main app
This commit is contained in:
parent
f7e0a357ea
commit
b91eae630c
4 changed files with 32 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -39,6 +39,7 @@ var/www/templates/header.html
|
|||
var/www/submitted
|
||||
var/www/server.crt
|
||||
var/www/server.key
|
||||
var/www/gunicorn.conf.py
|
||||
|
||||
# Local config
|
||||
configs/keys
|
||||
|
|
|
@ -40,7 +40,7 @@ ail_logs_syslog_level =
|
|||
|
||||
##### Notifications ######
|
||||
[Notifications]
|
||||
ail_domain = https://localhost:7000
|
||||
ail_domain = http://localhost:7000
|
||||
sender = sender@example.com
|
||||
sender_host = smtp.example.com
|
||||
sender_port = 1337
|
||||
|
@ -57,7 +57,7 @@ sender_user =
|
|||
#Proxying requests to the app
|
||||
baseUrl = /
|
||||
#Host to bind to
|
||||
host = 127.0.0.1
|
||||
host = 0.0.0.0
|
||||
#Flask server port
|
||||
port = 7000
|
||||
#Number of logs to display in the dashboard
|
||||
|
|
27
configs/gunicorn.conf.py
Normal file
27
configs/gunicorn.conf.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append('./modules/')
|
||||
sys.path.append(os.environ['AIL_BIN'])
|
||||
|
||||
from lib.ConfigLoader import ConfigLoader
|
||||
|
||||
|
||||
config_loader = ConfigLoader()
|
||||
|
||||
try:
|
||||
host = config_loader.get_config_str("Flask", "host")
|
||||
except Exception:
|
||||
host = '0.0.0.0'
|
||||
|
||||
try:
|
||||
port = config_loader.get_config_int("Flask", "port")
|
||||
except Exception:
|
||||
port = 7000
|
||||
|
||||
bind = f"{host}:{port}"
|
||||
workers = 2
|
||||
worker_class = 'sync'
|
||||
timeout = 180
|
||||
loglevel = 'info'
|
||||
limit_request_line = 0
|
|
@ -85,6 +85,8 @@ https://github.com/saffsd/langid.py/archive/master.zip
|
|||
|
||||
requests
|
||||
|
||||
# WSGI server to run Flask app
|
||||
gunicorn==20.1.0
|
||||
|
||||
##### Old packages
|
||||
# texttable
|
||||
|
|
Loading…
Reference in a new issue