Fixing Postorius only container image (#360)

* Fixing Postorius
* Getting rid of django_compressor from STATICFILES_FINDERS
This commit is contained in:
Danil Smirnov
2020-01-08 21:13:02 +02:00
committed by Abhilash Raj
parent 973169262b
commit 5ec6bd054f
3 changed files with 13 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ function wait_for_postgres () {
function wait_for_mysql () {
# Check if MySQL is up and accepting connections.
HOSTNAME=$(python <<EOF
HOSTNAME=$(python3 <<EOF
try:
from urllib.parse import urlparse
except ImportError:
@@ -106,17 +106,18 @@ fi
if [[ -e /opt/mailman-web-data/settings_local.py ]]; then
echo "Copying 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
echo "settings_local.py not found, it is highly recommended that you provide one"
echo "Using default configuration to run."
fi
# 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
# 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
# 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 ]];
then
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 || \
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