Lots of changes

This commit is contained in:
Dustin Pianalto
2019-09-14 11:28:53 -08:00
parent da60570aee
commit a47890f366
25 changed files with 1657 additions and 21 deletions
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh
set -o errexit
set -o pipefail
set -o nounset
if [ -z "${POSTGRES_USER}" ]; then
base_postgres_image_default_user='postgres'
export POSTGRES_USER="${base_postgres_image_default_user}"
fi
postgres_ready() {
python << END
import sys
import psycopg2
try:
psycopg2.connect(
dbname="${POSTGRES_DB}",
user="${POSTGRES_USER}",
password="${POSTGRES_PASSWORD}",
host="${POSTGRES_HOST}",
port="${POSTGRES_PORT}",
)
except psycopg2.OperationalError:
sys.exit(-1)
sys.exit(0)
END
}
until postgres_ready; do
>&2 echo 'Waiting for PostgreSQL to become available...'
sleep 1
done
>&2 echo 'PostgreSQL is available'
python manage.py collectstatic --noinput
python manage.py makemigrations
python manage.py migrate
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf