phase1: bootstrap containerized django stack and project scaffold
This commit is contained in:
21
entrypoint.sh
Executable file
21
entrypoint.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Waiting for PostgreSQL at ${POSTGRES_HOST}:${POSTGRES_PORT}..."
|
||||
until pg_isready -h "${POSTGRES_HOST}" -p "${POSTGRES_PORT}" -U "${POSTGRES_USER}"; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "PostgreSQL is available."
|
||||
|
||||
if [ "${AUTO_APPLY_MIGRATIONS:-0}" = "1" ] && [ "$1" = "gunicorn" ]; then
|
||||
echo "Applying database migrations..."
|
||||
python manage.py migrate --noinput
|
||||
fi
|
||||
|
||||
if [ "${AUTO_COLLECTSTATIC:-0}" = "1" ] && [ "$1" = "gunicorn" ]; then
|
||||
echo "Collecting static files..."
|
||||
python manage.py collectstatic --noinput
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user