Skip to content
Snippets Groups Projects
Select Git revision
  • 3e631a287e935cf87adfaa6e602975e6e03576a3
  • main default protected
2 results

docker-web-entrypoint.sh

Blame
  • docker-web-entrypoint.sh 479 B
    #!/bin/bash
    
    echo "Waiting for MySQL to be available"
    max_attempts=30
    count=0
    while ! mysqladmin ping -h"$DATABASE_HOST" --silent; do
        count=$((count+1))
        if [ $count -ge $max_attempts ]; then
            echo "ERROR: MySQL not available after $max_attempts attempts"
            exit 1
        fi
        sleep 1
    done
    echo "MySQL is available and ready"
    
    # Run Django migrations
    python manage.py migrate
    
    # Execute the command passed to this script
    echo "Executing command: $@"
    exec "$@"