dockerme
v1.0.0
Published
Automatically generate Dockerfiles by analyzing your codebase
Maintainers
Readme
Dockerize
Automatically generate Dockerfiles by analyzing your codebase. This npm package detects your project type and generates an appropriate Dockerfile for you.
Installation
npm installUsage
Local Development
After installing dependencies, you can run:
npm link
dockerizeAs npx Package
Once published to npm, you can use it directly with:
npx dockerizeFeatures
- 🔍 Automatic Detection: Analyzes your codebase to detect project type
- 🐳 Smart Dockerfiles: Generates optimized Dockerfiles for various frameworks
- 📦 Multi-language Support: Supports Node.js, Python, Java, Go, Rust, Ruby, PHP, and more
- ⚙️ Framework-aware: Detects specific frameworks like React, Next.js, Django, Flask, FastAPI, etc.
Supported Project Types
Node.js
- React/Vite: Multi-stage build with nginx
- Next.js: Optimized Next.js production build
- Backend: Express, Fastify, Koa, etc.
- Generic Node.js: Standard Node.js applications
Python
- Django: Includes migrations and static files
- Flask: Uses Gunicorn for production
- FastAPI: Uses Uvicorn server
- Generic Python: Standard Python applications
Java
- Maven: Multi-stage build with Maven
- Gradle: Multi-stage build with Gradle
Other Languages
- Go: Multi-stage build with Go
- Rust: Multi-stage build with Cargo
- Ruby: Rails applications
- PHP: Apache with Composer
Options
dockerize [options]
Options:
-V, --version Show version number
-o, --output <file> Output Dockerfile path (default: "Dockerfile")
-f, --force Overwrite existing Dockerfile
-h, --help Display help for commandExamples
Generate a Dockerfile in the current directory:
dockerizeGenerate a Dockerfile with a custom name:
dockerize -o Dockerfile.prodOverwrite an existing Dockerfile:
dockerize --forceHow It Works
- Analysis: Scans your project directory for configuration files (package.json, requirements.txt, pom.xml, etc.)
- Detection: Identifies the project type and framework based on detected files
- Generation: Creates an optimized Dockerfile template for your specific project type
Publishing to npm
To publish this package to npm:
npm login
npm publishAfter publishing, users can install and use it globally or via npx:
npx dockerizeLicense
MIT
