Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace "github" with "gitcontainer" in URLs to generate a dockerfile.

License

NotificationsYou must be signed in to change notification settings

coderamp-labs/gitcontainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitcontainer

Gitcontainer 🐳

Turn any GitHub repository into a production-ready Docker container with AI-powered Dockerfile generation.

MIT LicensePython 3.9+FastAPI

Gitcontainer is an AI-powered web application that automatically generates production-ready Dockerfiles by analyzing GitHub repositories. Simply paste a GitHub URL and get a tailored Dockerfile with intelligent base image selection, dependency management, and Docker best practices.

🌟 Quick Access

Simply replacegithub.com withgitcontainer.com in any GitHub repository URL to instantly access the Dockerfile generation page for that repository.

For example:

https://github.com/username/repo  →  https://gitcontainer.com/username/repo

✨ Features

  • 🔄 Instant URL Access: Just replace 'github.com' with 'gitcontainer.com' in any GitHub URL
  • 🤖 AI-Powered Analysis: Uses OpenAI GPT-4 to analyze repository structure and generate intelligent Dockerfiles
  • ⚡ Real-time Streaming: Watch the AI generate your Dockerfile in real-time with WebSocket streaming
  • 🎯 Smart Detection: Automatically detects technology stacks (Python, Node.js, Java, Go, etc.)
  • 🔧 Production-Ready: Generates Dockerfiles following best practices with proper security, multi-stage builds, and optimization
  • 📋 Additional Instructions: Add custom requirements for specialized environments
  • 📄 Docker Compose: Automatically suggests docker-compose.yml for complex applications
  • 🎨 Modern UI: Clean, responsive interface with Monaco editor for syntax highlighting
  • 📱 Mobile Friendly: Works seamlessly on desktop and mobile devices

🚀 Quick Start

Prerequisites

  • Python 3.9 or higher
  • Git
  • OpenAI API key

Installation

  1. Clone the repository:

    git clone https://github.com/cyclotruc/gitcontainer.gitcd gitcontainer
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up environment variables:

    # Create .env fileecho"OPENAI_API_KEY=your_openai_api_key_here"> .env
  4. Run the application:

    python app.py
  5. Open your browser:Navigate tohttp://localhost:8000

🛠️ How It Works

  1. URL Processing: Access any repository by replacing 'github.com' with 'gitcontainer.com' in the URL
  2. Repository Cloning: Gitcontainer clones the GitHub repository locally using Git
  3. Code Analysis: Usesgitingest to analyze the repository structure and extract relevant information
  4. AI Generation: Sends the analysis to OpenAI GPT-4 with specialized prompts for Dockerfile generation
  5. Smart Optimization: The AI considers:
    • Technology stack detection
    • Dependency management
    • Security best practices
    • Multi-stage builds when beneficial
    • Port configuration
    • Environment variables
    • Health checks

📁 Project Structure

cyclotruc-gitcontainer/├── app.py                 # Main FastAPI application├── requirements.txt       # Python dependencies├── .env                  # Environment variables (create this)├── static/               # Static assets (icons, CSS)├── templates/│   └── index.jinja       # Main HTML template└── tools/                # Core functionality modules    ├── __init__.py    ├── create_container.py  # AI Dockerfile generation    ├── git_operations.py    # GitHub repository cloning    └── gitingest.py        # Repository analysis

🔧 Configuration

Environment Variables

VariableDescriptionRequired
OPENAI_API_KEYYour OpenAI API keyYes
PORTServer port (default: 8000)No
HOSTServer host (default: 0.0.0.0)No

Advanced Usage

You can use the tools programmatically:

fromtoolsimportclone_repo_tool,gitingest_tool,create_container_toolimportasyncioasyncdefgenerate_dockerfile(github_url):# Clone repositoryclone_result=awaitclone_repo_tool(github_url)# Analyze with gitingestanalysis=awaitgitingest_tool(clone_result['local_path'])# Generate Dockerfiledockerfile=awaitcreate_container_tool(gitingest_summary=analysis['summary'],gitingest_tree=analysis['tree'],gitingest_content=analysis['content']    )returndockerfile# Usageresult=asyncio.run(generate_dockerfile("https://github.com/user/repo"))print(result['dockerfile'])

🎨 Customization

Adding Custom Instructions

Use the "Additional instructions" feature to customize generation:

  • "Use Alpine Linux for smaller image size"
  • "Include Redis and PostgreSQL"
  • "Optimize for production deployment"
  • "Add development tools for debugging"

📝 License

This project is licensed under the MIT License - see theLICENSE file for details.

🙏 Acknowledgments

🔗 Links


Made with ❤️ byRomain Courtois

Turn any repository into a container in seconds!

About

Replace "github" with "gitcontainer" in URLs to generate a dockerfile.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp