Skip to content

Commit

Permalink
feat: automatic static collect
Browse files Browse the repository at this point in the history
  • Loading branch information
fivehanz committed Aug 4, 2024
1 parent 6b2e2fd commit 42d8a9a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 42d8a9a

Please sign in to comment.