Files
bus-manager/entrypoint.sh
T

23 lines
512 B
Bash

#!/bin/sh
set -e
echo "Waiting for postgres..."
until pg_isready -h "$SQL_HOST" -p "$SQL_PORT" -U "$SQL_USER"; do
sleep 1
done
echo "PostgreSQL is up."
echo "Running migrations..."
python manage.py migrate --noinput
echo "Collecting static files..."
python manage.py collectstatic --noinput
echo "Starting Gunicorn..."
exec gunicorn busManager.wsgi:application \
--bind 0.0.0.0:8000 \
--workers ${GUNICORN_WORKERS:-3} \
--timeout ${GUNICORN_TIMEOUT:-120} \
--access-logfile - \
--error-logfile -