Created
June 9, 2018 21:20
-
-
Save augustogoulart/6bb539d09bea33bb22949e988f9cf241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#sleep 999999 | |
set -e | |
host="$1" | |
shift | |
cmd="$@" | |
until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "postgres" -c '\q'; do | |
>&2 echo "Postgres is unavailable - sleeping" | |
sleep 1 | |
done | |
>&2 echo "Postgres is up - executing command" | |
exec $cmd | |
./manage.py collectstatic --noinput | |
./manage.py migrate --noinput | |
cd /app/frontend | |
NODE_ENV=development PORT=3001 HOST=0.0.0.0 API_MOCK=1 npm run dev & | |
NODE_ENV=development PORT=3000 HOST=0.0.0.0 API_MOCK=0 npm run dev & | |
cd /app | |
DJANGO_DEBUG=1 ./manage.py runserver 0.0.0.0:8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment