Skip to content
Snippets Groups Projects
Commit 15373ed0 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

- Use gunicorn

- Add env variable GUNICORN_WORKERS (default: 1)
- new Port (8000)
- You don't need to run "flask deploy" by hand anymore
parent f9158348
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ ENV FLASK_APP=nopaque.py
ENV LANG=C.UTF-8
EXPOSE 5000
EXPOSE 8000
RUN apt-get update \
......
......@@ -5,10 +5,8 @@ wait-for-it db:5432 --strict --timeout=0
echo "Waiting for redis..."
wait-for-it redis:6379 --strict --timeout=0
if [ $# -eq 0 ]; then
venv/bin/python nopaque.py
elif [ $1 == "flask" ]; then
venv/bin/python -m $@
else
echo "Unknown command"
fi
GUNICORN_WORKERS="${GUNICORN_WORKERS:-1}"
source venv/bin/activate
flask deploy
gunicorn --bind :5000 --workers "${GUNICORN_WORKERS}" --worker-class eventlet nopaque:app
......@@ -14,7 +14,7 @@ GITLAB_PASSWORD=
### Flask ###
FLASK_CONFIG=
# SECRET_KEY=
SECRET_KEY=
### Flask-Mail ###
MAIL_SERVER=
......@@ -24,6 +24,9 @@ MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_DEFAULT_SENDER=
### Gunicorn ###
GUNICORN_WORKERS=
### nopaque ###
NOPAQUE_ADMIN=
NOPAQUE_STORAGE=
import eventlet
eventlet.monkey_patch() # noqa
from app import create_app, db, socketio
from app import create_app, db
from app.models import Corpus, Job, Role, User
from flask_migrate import Migrate, upgrade
import os
......@@ -34,7 +34,3 @@ 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')
......@@ -7,6 +7,7 @@ Flask-SocketIO
Flask-SQLAlchemy
Flask-Table
Flask-WTF
gunicorn
jsonpatch
psycopg2
redis
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment