Portal/rsconcept/backend/entrypoint.sh
IRBorisov 2759f10d09
Some checks failed
Backend CI / build (3.12) (push) Has been cancelled
Frontend CI / build (18.x) (push) Has been cancelled
Initial commit
2024-06-07 20:17:03 +03:00

19 lines
398 B
Bash

# Before doing anything wait for database to come online
if [ "$DB_ENGINE" = "django.db.backends.postgresql_psycopg2" ]
then
echo "Waiting DB..."
while ! nc -z $DB_HOST $DB_PORT;
do
sleep 0.1
done
echo "Ready!"
fi
cd $APP_HOME
python3.12 $APP_HOME/manage.py collectstatic --noinput --clear
python3.12 $APP_HOME/manage.py migrate
# Execute given input command
exec "$@"