npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dockerez

v1.0.1

Published

Automatically detect projects and generate Dockerfiles, Docker Compose configurations, and Docker environment files.

Readme

Dockerez

npm version

Automatically detect supported projects and generate Docker configuration with minimal setup. 🐋

Dockerez scans a project directory, detects supported frameworks and databases, and generates Dockerfiles, .dockerignore files, Docker Compose configurations, and environment templates.

Features

  • Recursive project detection
  • Automatic Dockerfile generation
  • Docker Compose generation
  • Database service detection
  • Persistent database volumes
  • Database healthchecks
  • Automatic service dependencies
  • .env.example generation
  • Docker configuration cleanup
  • Docker environment diagnostics
  • --force overwrite support
  • --no-compose mode for Dockerfile-only workflows
  • npm, Yarn and pnpm detection for Node.js projects
  • FastAPI detection for Python projects

Installation

Install from npm

npm install -g dockerez

Verify installation

dockerez --version

Quick Start

Navigate to the root directory of your project:

cd my-project

Analyze the project:

dockerez init

Generate Docker configuration:

dockerez generate

Dockerez will scan the directory and generate the appropriate Docker configuration based on the detected technologies.

Commands

dockerez init

Analyzes the current directory and reports detected projects and technologies.

dockerez init

Use this to inspect what Dockerez detects before generating Docker configuration.


dockerez generate

Generates Docker configuration for detected projects.

dockerez generate

Depending on the detected project, Dockerez can generate:

Dockerfile
.dockerignore
docker-compose.yml
.env.example

Existing files are protected by default.

If a generated file already exists, Dockerez will skip it and display a warning.


dockerez generate --force

Forces dockerez to overwrite existing Docker configuration files.

dockerez generate --force

Use this when you want to regenerate the configuration after changing the project structure or detected technologies.


dockerez generate --no-compose

Generates Dockerfiles and .dockerignore files without generating Docker Compose configuration.

dockerez generate --no-compose

This is useful when you only want containerization for individual projects and do not need a multi-container setup.

For example:

my-project/
├── Dockerfile
└── .dockerignore

No docker-compose.yml or .env.example is generated by this mode.

You can also combine it with --force:

dockerez generate --force --no-compose

dockerez clean

Removes Docker-related configuration files from the current project.

dockerez clean

Dockerez will first show the files it found and ask for confirmation.

The command can remove:

Dockerfile
Dockerfile.dev
Dockerfile.prod
docker-compose.yml
docker-compose.yaml
.dockerignore
.env.example

This command can remove Docker configuration regardless of whether dockerez originally created the files.


dockerez clean --force

Removes detected Docker configuration files without asking for confirmation.

dockerez clean --force

Use this carefully because existing Docker configuration files will be deleted.


dockerez doctor

Checks the local development environment for the tools dockerez relies on.

dockerez doctor

The diagnostic checks include:

  • Node.js
  • npm
  • Docker
  • Docker Compose
  • Current project
  • Common Docker configuration files

Example:

🩺 dockerez Doctor
================

✓ Node.js: v22.x.x
✓ npm: 10.x.x
✓ Docker: Docker version ...
✓ Docker Compose: Docker Compose version ...

Project:
  C:\Projects\my-project

✓ package.json: found
✓ Dockerfile: found
✓ docker-compose.yml: found

✅ Doctor check complete.

dockerez --help

Displays available commands and options.

dockerez --help

Individual commands also provide help:

dockerez generate --help
dockerez clean --help

dockerez --version

Displays the installed dockerez version.

Dockerez --version

Supported Technologies

Dockerez currently supports the following project types.

| Technology | Detection | Dockerfile | Compose | | ---------- | --------: | ---------: | ------: | | Vite | ✅ | ✅ | ✅ | | React | ✅ | — | — | | Express | ✅ | ✅ | ✅ | | Next.js | ✅ | ✅ | ✅ | | FastAPI | ✅ | ✅ | ✅ | | PostgreSQL | ✅ | — | ✅ | | MongoDB | ✅ | — | ✅ | | Redis | ✅ | — | ✅ |

React is detected as a frontend technology, while Vite is used as the Docker build strategy for Vite-based frontend applications.

Example Project

A project containing:

my-project/
├── client/
│   ├── package.json
│   └── src/
│
└── server/
    ├── package.json
    └── src/

where the client uses Vite/React and the server uses Express/PostgreSQL can be detected automatically.

Running:

dockerez generate

can produce:

my-project/
├── client/
│   ├── Dockerfile
│   └── .dockerignore
│
├── server/
│   ├── Dockerfile
│   └── .dockerignore
│
├── docker-compose.yml
└── .env.example

Docker Compose

For multi-service applications, Dockerez can generate a Compose configuration containing the detected application and database services.

For example:

services:
  client:
    build:
      context: ./client
    ports:
      - "5173:80"

  server:
    build:
      context: ./server
    ports:
      - "5000:5000"

  postgres:
    image: postgres:17
    ports:
      - "5432:5432"

Database services can include:

  • Persistent volumes
  • Healthchecks
  • Environment variables
  • Application dependencies
  • Internal Docker service names

Service networking

Containers communicate with each other using Docker Compose service names.

For example, PostgreSQL is reachable from another container using:

postgres:5432

rather than:

localhost:5432

Applications should therefore use environment variables such as:

DATABASE_URL

when connecting to databases inside Compose.

Environment Variables

When database services are detected, Dockerez can generate:

.env.example

For example:

POSTGRES_USER=postgres
POSTGRES_PASSWORD=change_me
POSTGRES_DB=app

Copy this file to .env and provide appropriate values before starting the Compose stack.

cp .env.example .env

On Windows PowerShell:

Copy-Item .env.example .env

Do not commit .env files containing real credentials.

Package Managers

For Node.js projects, dockerez detects common package managers using their lockfiles.

Supported package managers include:

  • npm
  • Yarn
  • pnpm

For example:

package-lock.json → npm
yarn.lock         → Yarn
pnpm-lock.yaml    → pnpm

Python projects currently support:

  • pip
  • Poetry
  • Pipenv

Generated Dockerfiles

Dockerez uses technology-specific templates.

Vite

Vite applications are built in a Node.js builder stage and served using Nginx.

Node.js
   ↓
npm run build
   ↓
Nginx
   ↓
port 80

Express

Express applications are packaged as Node.js containers and started using the project's production start command.

Next.js

Next.js applications are built and started using the Next.js production workflow.

FastAPI

FastAPI applications use a Python container and Uvicorn.

Development vs Production

Dockerez currently generates production-oriented Dockerfiles.

For example, Vite applications are built using:

npm run build

and served by Nginx rather than running the Vite development server.

This means a Compose mapping such as:

ports:
  - "5173:80"

makes the application available at:

http://localhost:5173

while the container itself continues to serve the production build on port 80.

Requirements

Dockerez requires:

  • Node.js 18 or newer

Docker and Docker Compose are required when you want to build or run the generated containers.

Check your environment with:

dockerez doctor

Project Structure

Dockerez itself is organized around scanning, analysis, configuration, and generation:

dockerez/
├── bin/
│   └── dockerez.js
│
├── src/
│   ├── commands/
│   │   ├── init.js
│   │   ├── generate.js
│   │   ├── clean.js
│   │   └── doctor.js
│   │
│   ├── core/
│   │   ├── analyzer.js
│   │   ├── fileScanner.js
│   │   ├── packageReader.js
│   │   ├── projectScanner.js
│   │   └── fileWriter.js
│   │
│   ├── detectors/
│   │   ├── express.js
│   │   ├── next.js
│   │   ├── vite.js
│   │   ├── react.js
│   │   ├── fastapi.js
│   │   ├── postgres.js
│   │   ├── mongodb.js
│   │   └── redis.js
│   │
│   ├── config/
│   │   ├── projectConfig.js
│   │   ├── nodeConfig.js
│   │   └── pythonConfig.js
│   │
│   └── generators/
│       ├── dockerfile.js
│       ├── dockerignore.js
│       ├── compose.js
│       └── env.js
│
├── templates/
│   ├── express/
│   ├── next/
│   ├── vite/
│   ├── fastapi/
│   └── common/
│
├── bin/
├── package.json
└── README.md

Development

Clone the repository and install dependencies:

npm install

During development, Dockerez can be linked globally:

npm link

Then:

dockerez --help

After making changes to the source code, the linked CLI uses the updated files.

License

MIT


~ By Bhargav Chaudhari