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
.dockerignore
file to optimize the build process. - Uses AI to generate
docker-compose.yml
anddockerreadme.md
for 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, specifyflask
ordjango
to generate an appropriate Dockerfile.
For a Flask project:
python -m my_docker_generator.main /path/to/project flask
For a Django project:
python -m my_docker_generator.main /path/to/project django
For a generic project:
python -m my_docker_generator.main /path/to/project
we4techai-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:
groq
pydantic
httpx
typing_extensions
certifi
sniffio
distro
anyio
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.yml
file. - Generates .dockerignore: Creates a
.dockerignore
file to improve build performance. - Generates Documentation: Generates a
dockerreadme.md
file 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.