HH/entrypoint.prod.sh
ismail c5f76b3855
Some checks are pending
Build and Push Docker Image / build (push) Waiting to run
updates
2026-05-11 14:45:30 +03:00

18 lines
523 B
Bash
Executable File

#!/bin/bash
set -e
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Waiting for database..."
until pg_isready -h ${DB_HOST:-db} -p ${DB_PORT:-5432} -U ${DB_USER:-px360} 2>/dev/null; do
sleep 1
done
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Database is ready."
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Running migrations..."
python manage.py migrate --noinput
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Collecting static files..."
python manage.py collectstatic --noinput || true
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting $@..."
exec "$@"