diff --git a/entrypoint.sh b/entrypoint.sh index 5d86f1d..cce51fd 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,26 @@ run_migrations() { python manage.py migrate } +collect_static() { + echo "----------------- collecting static files -----------------" + python manage.py collectstatic --noinput --clear + python manage.py collectstatic --noinput + python manage.py compress --force +} + +compress_static() { + echo "----------------- compressing static files -----------------" + python manage.py compress --force +} + +if [ "${COLLECT_STATIC:-false}" ]; then + collect_static + compress_static +else + echo "------------------ skipping collect static files -----------------" +fi + + if [ "${RUN_MIGRATION:-false}" = true ]; then run_migrations else