2020-01-07 14:06:31 +03:00
|
|
|
#!/bin/bash
|
2017-09-05 14:39:20 +03:00
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
2018-03-08 16:59:41 +03:00
|
|
|
set -o nounset
|
2017-09-05 14:39:20 +03:00
|
|
|
|
2018-03-08 16:59:41 +03:00
|
|
|
if [ -z "${POSTGRES_USER}" ]; then
|
2018-04-04 11:43:39 +03:00
|
|
|
base_postgres_image_default_user='postgres'
|
|
|
|
export POSTGRES_USER="${base_postgres_image_default_user}"
|
2016-03-08 12:12:55 +03:00
|
|
|
fi
|
2018-05-09 12:58:37 +03:00
|
|
|
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
|
2016-08-16 22:20:41 +03:00
|
|
|
|
2024-08-27 14:23:06 +03:00
|
|
|
wait-for-it "${POSTGRES_HOST}:${POSTGRES_PORT}" -t 30
|
2022-07-27 01:17:45 +03:00
|
|
|
|
2018-05-21 15:03:37 +03:00
|
|
|
>&2 echo 'PostgreSQL is available'
|
2018-03-08 16:59:41 +03:00
|
|
|
|
2018-05-21 14:59:20 +03:00
|
|
|
exec "$@"
|