From f9e30bd87c3bd08307ada55d303598b01f54d90e Mon Sep 17 00:00:00 2001 From: kaiyou Date: Thu, 8 Nov 2018 21:29:11 +0100 Subject: [PATCH] Update the dockerfile and upgrade dependencies --- core/admin/Dockerfile | 2 +- core/admin/requirements-prod.txt | 47 ++++++++++++++------------------ core/admin/requirements.txt | 1 - core/admin/start.sh | 7 +++-- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/core/admin/Dockerfile b/core/admin/Dockerfile index 2e637206..29eb69f6 100644 --- a/core/admin/Dockerfile +++ b/core/admin/Dockerfile @@ -11,12 +11,12 @@ RUN apk add --no-cache openssl \ COPY mailu ./mailu COPY migrations ./migrations -COPY manage.py . COPY start.sh /start.sh RUN pybabel compile -d mailu/translations EXPOSE 80/tcp VOLUME ["/data"] +ENV FLASK_APP mailu CMD ["/start.sh"] diff --git a/core/admin/requirements-prod.txt b/core/admin/requirements-prod.txt index e321a4d6..2ca59edc 100644 --- a/core/admin/requirements-prod.txt +++ b/core/admin/requirements-prod.txt @@ -1,53 +1,46 @@ -alembic==0.9.9 +alembic==1.0.2 asn1crypto==0.24.0 -Babel==2.5.3 +Babel==2.6.0 bcrypt==3.1.4 blinker==1.4 -certifi==2018.4.16 cffi==1.11.5 -chardet==3.0.4 -click==6.7 -cryptography==2.2.2 +Click==7.0 +cryptography==2.3.1 decorator==4.3.0 dnspython==1.15.0 -docker-py==1.10.6 -docker-pycreds==0.2.2 -dominate==2.3.1 -Flask==0.12.2 -Flask-Babel==0.11.2 +dominate==2.3.4 +Flask==1.0.2 +Flask-Babel==0.12.2 Flask-Bootstrap==3.3.7.1 Flask-DebugToolbar==0.10.1 Flask-Limiter==1.0.1 Flask-Login==0.4.1 -Flask-Migrate==2.1.1 +Flask-Migrate==2.3.0 Flask-Script==2.0.6 Flask-SQLAlchemy==2.3.2 Flask-WTF==0.14.2 -gunicorn==19.7.1 -idna==2.6 +gunicorn==19.9.0 +idna==2.7 infinity==1.4 intervals==0.8.1 -itsdangerous==0.24 +itsdangerous==1.1.0 Jinja2==2.10 limits==1.3 Mako==1.0.7 -MarkupSafe==1.0 +MarkupSafe==1.1.0 passlib==1.7.1 -pycparser==2.18 -pyOpenSSL==17.5.0 -python-dateutil==2.7.2 +pycparser==2.19 +pyOpenSSL==18.0.0 +python-dateutil==2.7.5 python-editor==1.0.3 -pytz==2018.4 -PyYAML==3.12 +pytz==2018.7 +PyYAML==3.13 redis==2.10.6 -requests==2.18.4 six==1.11.0 -SQLAlchemy==1.2.6 +SQLAlchemy==1.2.13 tabulate==0.8.2 -urllib3==1.22 -validators==0.12.1 +validators==0.12.2 visitor==0.1.3 -websocket-client==0.47.0 Werkzeug==0.14.1 -WTForms==2.1 +WTForms==2.2.1 WTForms-Components==0.10.3 diff --git a/core/admin/requirements.txt b/core/admin/requirements.txt index d6e7adb1..95a65bbe 100644 --- a/core/admin/requirements.txt +++ b/core/admin/requirements.txt @@ -12,7 +12,6 @@ redis WTForms-Components passlib gunicorn -docker-py tabulate PyYAML PyOpenSSL diff --git a/core/admin/start.sh b/core/admin/start.sh index 8208e4a1..b3538204 100755 --- a/core/admin/start.sh +++ b/core/admin/start.sh @@ -1,5 +1,6 @@ #!/bin/sh -python manage.py advertise -python manage.py db upgrade -gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload mailu:app +flask mailu advertise +flask db upgrade + +gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload "$FLASK_APP:create_app()"