Skip to content

Conversation

Copy link

Copilot AI commented Aug 25, 2025

This PR completes the Docker infrastructure for LeanRAG by implementing the missing components referenced in the MYSQL_DOCKER_README.md documentation. The existing documentation described a complete Docker setup, but several key files were missing from the repository.

What was missing

The MYSQL_DOCKER_README.md file documented a comprehensive Docker setup with three deployment options, but the following critical files were missing:

  • mysql-init/01-init.sql - MySQL initialization script for database setup
  • mysql-docker.sh - Management script for easy container operations

Without these files, users couldn't actually use the documented Docker setup methods.

What this PR adds

1. MySQL Initialization Script (mysql-init/01-init.sql)

  • Creates the leanrag_default database with proper UTF-8 configuration
  • Sets up character set and collation (utf8mb4_unicode_ci) to match database_utils.py requirements
  • Includes a verification table to confirm successful initialization
  • Automatically executed when MySQL container starts for the first time

2. Container Management Script (mysql-docker.sh)

A comprehensive management script providing:

  • start/stop/restart - Container lifecycle management
  • status - Shows container health and connection details
  • connect - Direct MySQL shell access
  • logs - Container log viewing
  • reset - Complete data cleanup and fresh start
  • build - Custom image building from Dockerfile.mysql
  • Colored output and error handling
  • Automatic health checks and readiness detection

3. Docker Compose Updates

  • Removed obsolete version attribute that was causing warnings
  • Maintained all existing functionality and configuration

Testing performed

Docker Compose setup - docker compose up -d mysql works correctly
Management script - All commands (start, stop, status, connect, etc.) function properly
Database connectivity - MySQL accessible on localhost:4321 with root/123 credentials
Database integration - database_utils.py functions work correctly with Docker setup
Table creation - Automatic creation of entities, relations, and communities tables
Data persistence - MySQL data persists across container restarts via Docker volumes

Usage examples

Users can now choose from three documented setup methods:

# Option 1: Docker Compose (Recommended)
docker compose up -d mysql

# Option 2: Management Script
./mysql-docker.sh start
./mysql-docker.sh status
./mysql-docker.sh connect

# Option 3: Direct Docker
docker build -f Dockerfile.mysql -t leangraph-mysql .
docker run -d --name leangraph-mysql -p 4321:3306 leangraph-mysql

This implementation ensures that the LeanRAG framework now has complete, production-ready Docker support that matches the existing documentation, making it significantly easier for users to deploy and develop with the framework.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ement script

Co-authored-by: marklabz <39209396+marklabz@users.noreply.github.com>
Copilot AI changed the title [WIP] Major improvements: Docker support, enhanced LeanRAG framework, new features and structure Complete Docker support for LeanRAG with MySQL container setup and management tools Aug 25, 2025
Copilot AI requested a review from marklabz August 25, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants