My-Docker-Image-Generator is a tool that utilizes AI assistance to automatically generate Dockerfiles, docker-compose.yml, and other configuration files based on the project structure. This simplifies the process of containerizing applications.
- Automatically detects the project framework.
- Generates Dockerfiles for various frameworks including Python, React, Streamlit, Angular, Java, Ruby, C++, and Fullstack applications.
- Generates a
.dockerignorefile to optimize the build process. - Uses AI to generate
docker-compose.ymlanddockerreadme.mdfor better container orchestration. - Provides CLI support for easy usage.
- Supports advanced customization for generated files.
To install My-Docker-Image-Generator, use:
pip install .To generate Docker configuration files, run:
python -m my_docker_generator.main [project_directory] [python_variant]project_directory(Optional): The path to the project directory. Defaults to the current directory.python_variant(Optional): If the project is Python-based, specifyflaskordjangoto generate an appropriate Dockerfile.
For a Flask project:
python -m my_docker_generator.main /path/to/project flaskFor a Django project:
python -m my_docker_generator.main /path/to/project djangoFor a generic project:
python -m my_docker_generator.main /path/to/projectwe4techai-my-docker-image-generator/
├── README.md
└── my_docker_generator/
├── setup.py
└── my_docker_generator/
├── __init__.py
├── ai_utils.py
├── docker_generator.py
├── file_utils.py
├── framework_detector.py
├── main.py
├── requirements.txt
├── config/
│ ├── default_config.json
│ ├── custom_templates/
│ └── settings.py
└── __pycache__/
The project requires the following dependencies:
groqpydantichttpxtyping_extensionscertifisniffiodistroanyio
Dependencies are listed in requirements.txt.
- Detects Framework: The tool analyzes the project structure to determine the framework.
- Generates Dockerfile: Based on the detected framework, it creates a
Dockerfile. - Generates docker-compose.yml: Uses AI to generate a
docker-compose.ymlfile. - Generates .dockerignore: Creates a
.dockerignorefile to improve build performance. - Generates Documentation: Generates a
dockerreadme.mdfile using AI to document how to use the generated files. - Supports Customization: Allows users to modify and fine-tune generated configurations.
- Python (Flask, Django, Generic)
- React
- Streamlit
- Angular
- Java
- Ruby
- C++
- Fullstack (Python + React)
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Submit a pull request.
This project is licensed under the MIT License.