Fixing Postorius only container image (#360)
* Fixing Postorius * Getting rid of django_compressor from STATICFILES_FINDERS
This commit is contained in:
committed by
Abhilash Raj
parent
973169262b
commit
5ec6bd054f
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.6-alpine
|
FROM alpine:3.8
|
||||||
|
|
||||||
MAINTAINER Abhilash Raj
|
MAINTAINER Abhilash Raj
|
||||||
|
|
||||||
@@ -12,11 +12,12 @@ COPY docker-entrypoint.sh /usr/local/bin/
|
|||||||
# rights for management script
|
# rights for management script
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \
|
&& apk add --no-cache --virtual .build-deps gcc libc-dev linux-headers \
|
||||||
postgresql-dev mariadb-dev libffi-dev \
|
postgresql-dev mariadb-dev python3-dev libffi-dev \
|
||||||
&& apk add --no-cache --virtual .mailman-rundeps bash libffi \
|
&& apk add --no-cache --virtual .mailman-rundeps bash sassc \
|
||||||
postgresql-client mysql-client py-mysqldb curl mailcap \
|
postgresql-client mysql-client py-mysqldb curl mailcap \
|
||||||
&& pip install -U 'Django<3.0' pip \
|
python3 py3-setuptools libffi \
|
||||||
&& pip install postorius==1.3.1 \
|
&& python3 -m pip install -U 'Django<3.0' pip \
|
||||||
|
&& python3 -mpip install postorius==1.3.1 \
|
||||||
uwsgi \
|
uwsgi \
|
||||||
psycopg2 \
|
psycopg2 \
|
||||||
dj-database-url \
|
dj-database-url \
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function wait_for_postgres () {
|
|||||||
|
|
||||||
function wait_for_mysql () {
|
function wait_for_mysql () {
|
||||||
# Check if MySQL is up and accepting connections.
|
# Check if MySQL is up and accepting connections.
|
||||||
HOSTNAME=$(python <<EOF
|
HOSTNAME=$(python3 <<EOF
|
||||||
try:
|
try:
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -106,17 +106,18 @@ fi
|
|||||||
if [[ -e /opt/mailman-web-data/settings_local.py ]]; then
|
if [[ -e /opt/mailman-web-data/settings_local.py ]]; then
|
||||||
echo "Copying settings_local.py ..."
|
echo "Copying settings_local.py ..."
|
||||||
cp /opt/mailman-web-data/settings_local.py /opt/mailman-web/settings_local.py
|
cp /opt/mailman-web-data/settings_local.py /opt/mailman-web/settings_local.py
|
||||||
|
chown mailman:mailman /opt/mailman-web/settings_local.py
|
||||||
else
|
else
|
||||||
echo "settings_local.py not found, it is highly recommended that you provide one"
|
echo "settings_local.py not found, it is highly recommended that you provide one"
|
||||||
echo "Using default configuration to run."
|
echo "Using default configuration to run."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect static for the django installation.
|
# Collect static for the django installation.
|
||||||
python manage.py collectstatic --noinput
|
python3 manage.py collectstatic --noinput
|
||||||
|
|
||||||
# Migrate all the data to the database if this is a new installation, otherwise
|
# Migrate all the data to the database if this is a new installation, otherwise
|
||||||
# this command will upgrade the database.
|
# this command will upgrade the database.
|
||||||
python manage.py migrate
|
python3 manage.py migrate
|
||||||
|
|
||||||
# If MAILMAN_ADMIN_USER and MAILMAN_ADMIN_EMAIL is defined create a new
|
# If MAILMAN_ADMIN_USER and MAILMAN_ADMIN_EMAIL is defined create a new
|
||||||
# superuser for Django. There is no password setup so it can't login yet unless
|
# superuser for Django. There is no password setup so it can't login yet unless
|
||||||
@@ -124,7 +125,7 @@ python manage.py migrate
|
|||||||
if [[ -v MAILMAN_ADMIN_USER ]] && [[ -v MAILMAN_ADMIN_EMAIL ]];
|
if [[ -v MAILMAN_ADMIN_USER ]] && [[ -v MAILMAN_ADMIN_EMAIL ]];
|
||||||
then
|
then
|
||||||
echo "Creating admin user $MAILMAN_ADMIN_USER ..."
|
echo "Creating admin user $MAILMAN_ADMIN_USER ..."
|
||||||
python manage.py createsuperuser --noinput --username "$MAILMAN_ADMIN_USER"\
|
python3 manage.py createsuperuser --noinput --username "$MAILMAN_ADMIN_USER"\
|
||||||
--email "$MAILMAN_ADMIN_EMAIL" 2> /dev/null || \
|
--email "$MAILMAN_ADMIN_EMAIL" 2> /dev/null || \
|
||||||
echo "Superuser $MAILMAN_ADMIN_USER already exists"
|
echo "Superuser $MAILMAN_ADMIN_USER already exists"
|
||||||
fi
|
fi
|
||||||
@@ -134,7 +135,7 @@ fi
|
|||||||
if [[ -v SERVE_FROM_DOMAIN ]];
|
if [[ -v SERVE_FROM_DOMAIN ]];
|
||||||
then
|
then
|
||||||
echo "Setting $SERVE_FROM_DOMAIN as the default domain ..."
|
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')"
|
"from django.contrib.sites.models import Site; Site.objects.filter(domain='example.com').update(domain='$SERVE_FROM_DOMAIN', name='$SERVE_FROM_DOMAIN')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ STATIC_URL = '/static/'
|
|||||||
STATICFILES_FINDERS = (
|
STATICFILES_FINDERS = (
|
||||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||||
'compressor.finders.CompressorFinder',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user