Remove postgres check from entrypoint
This commit is contained in:
parent
a6486447ea
commit
6cd5e5ad14
@ -4,39 +4,6 @@ set -o errexit
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
if [ -z "${POSTGRES_USER}" ]; then
|
|
||||||
base_postgres_image_default_user='postgres'
|
|
||||||
export POSTGRES_USER="${base_postgres_image_default_user}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Checking on PostgreSQL"
|
|
||||||
|
|
||||||
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 collectstatic --noinput
|
||||||
python manage.py makemigrations --noinput
|
python manage.py makemigrations --noinput
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user