From 3a05a4d2f4e4a3c8d7c3c8d06f0ed8f895d5aa1d Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Mon, 27 Apr 2020 09:34:12 +0200 Subject: [PATCH] Switch back to socketio server while development --- docker-entrypoint.sh | 2 +- nopaque.env.tpl | 3 --- nopaque.py | 6 +++++- requirements.txt | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b60b3ea2..cdb5c355 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,7 +10,7 @@ GUNICORN_WORKERS="${GUNICORN_WORKERS:-1}" source venv/bin/activate if [ $# -eq 0 ]; then flask deploy - gunicorn --access-logfile - --bind :5000 --error-logfile - --workers "${GUNICORN_WORKERS}" --worker-class eventlet nopaque:app + python nopaque.py elif [ $1 == "flask" ]; then flask ${@:2} else diff --git a/nopaque.env.tpl b/nopaque.env.tpl index 7bc4e2d4..6e39a0e0 100644 --- a/nopaque.env.tpl +++ b/nopaque.env.tpl @@ -23,9 +23,6 @@ MAIL_USE_TLS= MAIL_USERNAME= MAIL_PASSWORD= -### Gunicorn ### -GUNICORN_WORKERS= - ### nopaque ### NOPAQUE_ADMIN= NOPAQUE_MAIL_SENDER= diff --git a/nopaque.py b/nopaque.py index 57d41eef..b1e5a2ec 100644 --- a/nopaque.py +++ b/nopaque.py @@ -1,6 +1,6 @@ import eventlet eventlet.monkey_patch() # noqa -from app import create_app, db +from app import create_app, db, socketio from app.models import Corpus, Job, Role, User from flask_migrate import Migrate, upgrade import os @@ -34,3 +34,7 @@ def test(): import unittest tests = unittest.TestLoader().discover('tests') unittest.TextTestRunner(verbosity=2).run(tests) + + +if __name__ == '__main__': + socketio.run(app, host='0.0.0.0') diff --git a/requirements.txt b/requirements.txt index ef0254a9..d5d9f24d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,6 @@ Flask-SocketIO Flask-SQLAlchemy Flask-Table Flask-WTF -gunicorn jsonpatch psycopg2 redis