#!/bin/sh echo "Waiting for Postgres..." while ! nc -z "db" "5432"; do sleep 0.1 done echo "PostgreSQL started" PGPASSWORD="RoEGG5g7&b" # Random generated, corresponds to the one in docker-compose.yml if psql "postgresql://mam-web:$PGPASSWORD@db:5432/mam_docker" -t -c '\dt' | cut -d \| -f 2 | grep -qw "seminar_cisla"; then echo "\nExistuje tabulka 'seminar_cisla' v db, testdata pravděpodobně byla vygenerována.\n" else python ./manage.py testdata python ./manage.py loaddata data/* fi exec "$@"