dockerfiler
v1.0.2
Published
AI-powered Dockerfile generator using Groq API
Downloads
299
Maintainers
Readme
Dockerfiler
AI-powered Dockerfile generator using Groq API. Automatically generates optimized Dockerfiles based on your project's package.json.
Installation
npx dockerfilerOr install globally:
npm install -g dockerfiler
dockerfilerUsage
Navigate to your Node.js project directory (must contain package.json) and run:
npx dockerfilerThe tool will:
- Analyze your package.json
- Generate an optimized Dockerfile using AI
- Create a .dockerignore file
- Display the generated Dockerfile
Requirements
- Node.js 14 or higher
- A package.json file in your project
Features
- Zero external dependencies (uses only Node.js built-in modules)
- Generates production-ready Dockerfiles
- Supports various frameworks (Next.js, Express, React, etc.)
- Creates optimized .dockerignore files
- Uses Groq's Kimi AI model for intelligent Dockerfile generation
Example
cd my-nodejs-project
npx dockerfilerOutput:
Detected project: my-app
Analyzing project and generating Dockerfile...
Generated Dockerfile and .dockerignore
==================================================
Generated Dockerfile:
==================================================
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
==================================================
Next steps:
1. Review the Dockerfile
2. Build: docker build -t myapp .
3. Run: docker run -p 3000:3000 myappHow It Works
Dockerfiler analyzes your package.json to detect:
- Project type (web app, API, CLI tool, etc.)
- Framework (Next.js, Express, NestJS, etc.)
- Dependencies and scripts
Then generates a Dockerfile with:
- Optimal base image (Alpine for smaller size)
- Multi-stage builds when beneficial
- Minimized layers for faster builds
- Security best practices (non-root user)
- Framework-specific optimizations
License
MIT
Author
Kiran Kumar Pradhan
