Skip to content
Snippets Groups Projects
Select Git revision
  • f5e76660669bd4e12d55549704612c841eecdc98
  • master default protected
  • module-fun
3 results

README.md

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 "$@"