Skip to content
Snippets Groups Projects
entrypoint.sh 338 B
Newer Older
  • Learn to ignore specific revisions
  • Rafael László's avatar
    Rafael László committed
    #!/bin/sh
    
    
    if [ "$DJANGO_SETTINGS_MODULE" = "kszkepzes.settings.production" ]
    
    Rafael László's avatar
    Rafael László committed
    then
        echo "Waiting for postgres..."
    
        while ! nc -z $DB_HOST $DB_PORT; do
          sleep 0.1
        done
    
        echo "PostgreSQL started"
    fi
    
    python manage.py flush --no-input
    python manage.py migrate
    
    Rafael László's avatar
    Rafael László committed
    python manage.py collectstatic --no-input --clear
    
    Rafael László's avatar
    Rafael László committed
    
    exec "$@"