-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
36 lines (29 loc) · 927 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -euo pipefail
run_migrations() {
echo "----------------- Applying database migrations -----------------"
python manage.py makemigrations
python manage.py migrate
}
collect_static() {
echo "----------------- collecting static files -----------------"
python manage.py collectstatic --noinput --clear
python manage.py collectstatic --noinput
}
compress_static() {
echo "----------------- compressing static files -----------------"
python manage.py compress --force
}
if [ "${COLLECT_STATIC:-false}" = true ]; then
collect_static
compress_static
else
echo "------------------ skipping collect static files -----------------"
fi
if [ "${RUN_MIGRATION:-false}" = true ]; then
run_migrations
else
echo "----------------- Skipping database migrations -----------------"
fi
echo "-------------------- Starting server --------------------"
exec "$@"