From b5fd50226a4c0a7228b0681d10938aacf2be3000 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Sat, 22 Aug 2020 11:56:03 -0700 Subject: [PATCH] Compile all the i18n files installed in the container. Also, compress the static files offline. --- web/docker-entrypoint.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/docker-entrypoint.sh b/web/docker-entrypoint.sh index ba5f9e1..2657004 100755 --- a/web/docker-entrypoint.sh +++ b/web/docker-entrypoint.sh @@ -115,6 +115,16 @@ fi # Collect static for the django installation. python3 manage.py collectstatic --noinput --clear --verbosity 0 + +# Compile all the installed po files to mo. +SITE_DIR=$(python3 -c 'import site; print(site.getsitepackages()[0])') +echo "Compiling locale files in $SITE_DIR" +cd $SITE_DIR && /opt/mailman-web/manage.py compilemessages && cd - + +# Compress static files. +python3 manage.py compress --force + + # Migrate all the data to the database if this is a new installation, otherwise # this command will upgrade the database. python3 manage.py migrate