-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
32 lines (27 loc) · 871 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
32 lines (27 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
source $HOME/ghiblimovies.env
# This must be used if we have to wait by database
#
#set -euo pipefail
#WAIT_FOR_POSTGRES=${WAIT_FOR_POSTGRES:-true}
#if [[ "$WAIT_FOR_POSTGRES" = true ]]; then
# DATABASE_URL=${DATABASE_URL:-postgres://admin:admin@database:5432/movies}
# # convert to connection string
# POSTGRES_URL=${DATABASE_URL%%\?*}
# POSTGRES_URL=${POSTGRES_URL/#postgres:/database:}
# let postgres and other services to warm up....
# until psql $POSTGRES_URL -c '\q'; do
# >&2 echo "**** Postgres database is not available - sleeping"
# sleep 3
# done
#fi
#if [[ $# -ge 1 ]]; then
# exec "$@"
#else
echo "Applying migrations"
# migrations
python manage.py makemigrations
python manage.py migrate
echo "Starting server"
#fi
exec python manage.py runserver 0.0.0.0:8000 && celery -A ghiblimovies worker -l INFO