A web-based tool that automatically generates production-ready Dockerfiles for different programming languages using AI. Built with Flask and Ollama AI.
- Web interface for easy Dockerfile generation
- AI-powered Dockerfile creation using Ollama
- Produces production-ready Dockerfiles with best practices
- Input validation and error handling
- Supports multiple programming languages
- Python 3.x
- Docker (optional, for testing generated Dockerfiles)
- Ollama installed and running locally (In this script, Ollama 3.2:1b model is being used. Change accordingly).
-
Clone the repository:
git clone https://github.com/shafnir/dockerfile-generator.git cd Dockerfile_Generator -
Install dependencies:
pip install -r requirements.txt
-
Start the web application:
python main.py
-
Open your browser and navigate to
http://localhost:5000 -
Enter your programming language in the web interface
-
Click generate to receive a customized, production-ready Dockerfile
The application provides a REST API endpoint:
POST /generate- Request body:
{"language": "your-language"} - Returns:
{"dockerfile": "generated-dockerfile-content"}
- Request body: