From 423d9cbf0359f65fbd3024f6db4067b84c3a7b4c Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Sat, 13 Apr 2019 21:04:42 -0700 Subject: [PATCH] Add libffi to all Postorius images. (#320) * Add libffi to all Postorius images. * Use Django less than a certain version. * Fix the version constraint. * Fix uwsgi configuration by using only processes. --- postorius/Dockerfile | 4 ++-- postorius/Dockerfile.dev | 6 +++--- postorius/mailman-web/uwsgi.ini | 6 +----- tests/test.sh | 2 +- web/Dockerfile | 4 ++-- web/Dockerfile.dev | 16 ++++++++-------- web/mailman-web/uwsgi.ini | 3 +-- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/postorius/Dockerfile b/postorius/Dockerfile index 6f5050e..59846f5 100644 --- a/postorius/Dockerfile +++ b/postorius/Dockerfile @@ -12,8 +12,8 @@ COPY docker-entrypoint.sh /usr/local/bin/ # rights for management script RUN set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev \ - && apk add --no-cache --virtual .mailman-rundeps bash \ + postgresql-dev mariadb-dev libffi-dev \ + && apk add --no-cache --virtual .mailman-rundeps bash libffi \ postgresql-client mysql-client py-mysqldb curl mailcap \ && pip install -U Django==2.1.5 pip \ && pip install postorius==1.2.3 \ diff --git a/postorius/Dockerfile.dev b/postorius/Dockerfile.dev index 479d9c4..3bb667c 100644 --- a/postorius/Dockerfile.dev +++ b/postorius/Dockerfile.dev @@ -16,8 +16,8 @@ ARG CLIENT_REF # rights for management script RUN set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers git \ - postgresql-dev mariadb-dev \ - && apk add --no-cache --virtual .mailman-rundeps bash \ + postgresql-dev mariadb-dev libffi-dev \ + && apk add --no-cache --virtual .mailman-rundeps bash libffi \ postgresql-client mysql-client py-mysqldb curl mailcap \ && pip install -U git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \ git+https://gitlab.com/mailman/postorius@${POSTORIUS_REF} \ @@ -26,7 +26,7 @@ RUN set -ex \ psycopg2 \ dj-database-url \ mysqlclient \ - && pip install -U django==2.1.5\ + && pip install -U 'Django<2.2' \ && pip install -U git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \ && apk del .build-deps \ && addgroup -S mailman \ diff --git a/postorius/mailman-web/uwsgi.ini b/postorius/mailman-web/uwsgi.ini index 543eedd..b95ff2c 100644 --- a/postorius/mailman-web/uwsgi.ini +++ b/postorius/mailman-web/uwsgi.ini @@ -3,9 +3,6 @@ uwsgi-socket = 0.0.0.0:8080 http-socket = 0.0.0.0:8000 -#Enable threading for python -enable-threads = true - # Move to the directory wher the django files are. chdir = /opt/mailman-web @@ -14,8 +11,7 @@ wsgi-file = wsgi.py # Setup default number of processes and threads per process. master = true -process = 2 -threads = 2 +process = 4 # Drop privielges and don't run as root. uid = mailman diff --git a/tests/test.sh b/tests/test.sh index 8d16e7c..6955b4e 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -18,7 +18,7 @@ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mai docker-compose ps # Sleep for a while and check again if the containers are up. -sleep 30 +sleep 60 docker ps # Check if there is anything interesting in the logs. diff --git a/web/Dockerfile b/web/Dockerfile index 75409d3..55b7afd 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -12,10 +12,10 @@ COPY docker-entrypoint.sh /usr/local/bin/ # rights for management script RUN set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \ - postgresql-dev mariadb-dev python3-dev \ + postgresql-dev mariadb-dev python3-dev libffi-dev \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ postgresql-client mysql-client py-mysqldb curl mailcap \ - python3 py3-setuptools xapian-core xapian-bindings-python3 \ + python3 py3-setuptools xapian-core xapian-bindings-python3 libffi \ && python3 -m pip install -U django==2.1.5 pip \ && python3 -m pip install mailmanclient==3.2.1 \ postorius==1.2.3 \ diff --git a/web/Dockerfile.dev b/web/Dockerfile.dev index 07d2074..deb5f97 100644 --- a/web/Dockerfile.dev +++ b/web/Dockerfile.dev @@ -17,10 +17,10 @@ ARG CLIENT_REF # rights for management script RUN set -ex \ && apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers git \ - postgresql-dev mariadb-dev python3-dev \ + postgresql-dev mariadb-dev python3-dev libffi-dev \ && apk add --no-cache --virtual .mailman-rundeps bash sassc \ - python3 py3-setuptools postgresql-client mysql-client py-mysqldb\ - curl mailcap xapian-core xapian-bindings-python3 \ + python3 py3-setuptools postgresql-client mysql-client py-mysqldb\ + curl mailcap xapian-core xapian-bindings-python3 libffi \ && python3 -m pip install -U \ git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \ git+https://gitlab.com/mailman/postorius@${POSTORIUS_REF} \ @@ -29,11 +29,11 @@ RUN set -ex \ uwsgi \ psycopg2 \ dj-database-url \ - mysqlclient \ - xapian-haystack \ - && python3 -m pip install -U django>=1.11\ - && python3 -m pip install -U \ - git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \ + mysqlclient \ + xapian-haystack \ + && python3 -m pip install -U 'Django<2.2' \ + && python3 -m pip install -U \ + git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \ && apk del .build-deps \ && addgroup -S mailman \ && adduser -S -G mailman mailman \ diff --git a/web/mailman-web/uwsgi.ini b/web/mailman-web/uwsgi.ini index 4a24c52..0c68723 100644 --- a/web/mailman-web/uwsgi.ini +++ b/web/mailman-web/uwsgi.ini @@ -14,8 +14,7 @@ wsgi-file = wsgi.py # Setup default number of processes and threads per process. master = true -process = 2 -threads = 2 +process = 4 # Drop privielges and don't run as root. uid = mailman