#!/bin/bash set -e echo "Waiting for PostgreSQL..." while ! nc -z postgres_db 5432; do sleep 1 done echo "PostgreSQL is ready!" echo "Running migrations..." python smartsoltech/manage.py migrate --noinput echo "Collecting static files..." python smartsoltech/manage.py collectstatic --noinput || true echo "Starting Django server..." exec python smartsoltech/manage.py runserver 0.0.0.0:8000