18 lines
319 B
Bash
18 lines
319 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
# Wait for postgres to be ready
|
||
|
while ! nc -z db 5432; do
|
||
|
echo "Waiting for postgres..."
|
||
|
sleep 1
|
||
|
done
|
||
|
|
||
|
echo "PostgreSQL started"
|
||
|
|
||
|
# Apply database migrations
|
||
|
echo "Applying database migrations..."
|
||
|
python manage.py migrate
|
||
|
|
||
|
# Start server
|
||
|
echo "Starting server..."
|
||
|
python manage.py runserver 0.0.0.0:8000
|