forked from kristjan/cjvt-valency
css fix, preparing prod
This commit is contained in:
@@ -13,4 +13,4 @@ build: build-cjvt-python-env
|
||||
cd ../..; docker build . -f Dockerfile-backend-flask -t $(IMG)
|
||||
|
||||
build-cjvt-python-env:
|
||||
cd ../../dockerfiles/python-env; $(MAKE) build
|
||||
cd ../../dockerfiles/python-env; $(MAKE) build
|
||||
|
||||
@@ -500,18 +500,15 @@ def prepare_app_index(appindex_json, sskj_wordlist):
|
||||
|
||||
|
||||
def init_wsgi(app):
|
||||
print("Initiating wsgi")
|
||||
config = None
|
||||
with Path("/project/prod_conf.yaml").open("r") as fp:
|
||||
config = list(yaml.safe_load_all(fp))[0]
|
||||
|
||||
app.debug = False
|
||||
logfile = config["logfile"]
|
||||
if app.debug:
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(filename=logfile, level=logging.INFO)
|
||||
logging.basicConfig(filename=logfile, level=logging.INFO)
|
||||
|
||||
# db login
|
||||
# app index from db
|
||||
with Path(config["appindex"]).open("r") as fp:
|
||||
# a dirty hack but ok
|
||||
@@ -522,8 +519,8 @@ def init_wsgi(app):
|
||||
|
||||
|
||||
# if we don't pass arguments, assume production environment (gunicorn)
|
||||
if len(sys.argv) == 1:
|
||||
init_wsgi()
|
||||
if "gunicorn" in sys.argv[0]:
|
||||
init_wsgi(app)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -4,4 +4,5 @@ pip3 install -e /project/src/pkg/cjvt-corpusparser/.
|
||||
pip3 install -e /project/src/pkg/valency/.
|
||||
pip3 install -e /project/src/pkg/seqparser/.
|
||||
|
||||
sleep 10000
|
||||
cd /project/src/backend_flask
|
||||
gunicorn -t 2 -b 127.0.0.1:8084 app:app
|
||||
|
||||
Reference in New Issue
Block a user