From 5ec6bd054f6fa536707045f4a0d8282b6bb4c0f9 Mon Sep 17 00:00:00 2001 From: Danil Smirnov <27999539+danil-smirnov@users.noreply.github.com> Date: Wed, 8 Jan 2020 21:13:02 +0200 Subject: [PATCH] Fixing Postorius only container image (#360) * Fixing Postorius * Getting rid of django_compressor from STATICFILES_FINDERS --- postorius/Dockerfile | 13 +++++++------ postorius/docker-entrypoint.sh | 11 ++++++----- postorius/mailman-web/settings.py | 1 - 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/postorius/Dockerfile b/postorius/Dockerfile index cf81e72..219c941 100644 --- a/postorius/Dockerfile +++ b/postorius/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6-alpine +FROM alpine:3.8 MAINTAINER Abhilash Raj @@ -12,11 +12,12 @@ 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 libffi-dev \ - && apk add --no-cache --virtual .mailman-rundeps bash libffi \ - postgresql-client mysql-client py-mysqldb curl mailcap \ - && pip install -U 'Django<3.0' pip \ - && pip install postorius==1.3.1 \ + 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 libffi \ + && python3 -m pip install -U 'Django<3.0' pip \ + && python3 -mpip install postorius==1.3.1 \ uwsgi \ psycopg2 \ dj-database-url \ diff --git a/postorius/docker-entrypoint.sh b/postorius/docker-entrypoint.sh index 69111f4..4163234 100755 --- a/postorius/docker-entrypoint.sh +++ b/postorius/docker-entrypoint.sh @@ -16,7 +16,7 @@ function wait_for_postgres () { function wait_for_mysql () { # Check if MySQL is up and accepting connections. - HOSTNAME=$(python < /dev/null || \ echo "Superuser $MAILMAN_ADMIN_USER already exists" fi @@ -134,7 +135,7 @@ fi if [[ -v SERVE_FROM_DOMAIN ]]; then echo "Setting $SERVE_FROM_DOMAIN as the default domain ..." - python manage.py shell -c \ + python3 manage.py shell -c \ "from django.contrib.sites.models import Site; Site.objects.filter(domain='example.com').update(domain='$SERVE_FROM_DOMAIN', name='$SERVE_FROM_DOMAIN')" fi diff --git a/postorius/mailman-web/settings.py b/postorius/mailman-web/settings.py index 4f784bd..38177bb 100644 --- a/postorius/mailman-web/settings.py +++ b/postorius/mailman-web/settings.py @@ -194,7 +194,6 @@ STATIC_URL = '/static/' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - 'compressor.finders.CompressorFinder', )