#!/usr/bin/env bash
set -e

echo "Waiting for Postgres..."
until pg_isready -h "${POSTGRES_HOST:-db}" -p "${POSTGRES_PORT:-5432}" -U "${POSTGRES_USER:-illustrations}" >/dev/null 2>&1; do
  sleep 1
done

python manage.py migrate

python manage.py runserver 0.0.0.0:8000