Smart Dockerfile generation CLI for Node.js and Python projects
Project description
Dockermind
Smart Dockerfile generation CLI for Node.js and Python projects.
Overview
Dockermind analyses a project (Node.js or Python), infers the runtime and framework, and generates production-optimised Dockerfile and .dockerignore (optionally a docker-compose.yml). It also provides a small CLI to build and run the resulting image and a doctor command to validate the local Docker environment.
This repository contains a Next.js frontend (in the app/ and components/ folders) and the dockermind Python package that implements analysis and generation logic.
Requirements
- Python 3.10 or newer (the package declares
requires-python = ">=3.10") - Docker (for
dockermind build,dockermind runand to validate withdockermind doctor) - Node.js (for the Next.js frontend; development and build use the
nextCLI)
When running commands below, ensure you are in the repository root.
Node / Frontend commands (npm scripts)
The repository defines the following npm scripts in package.json. These are the standard Next.js scripts and an ESLint target.
-
npm run dev(alias:pnpm dev/yarn dev) — Runsnext dev.- What it does: starts the Next.js development server. The server serves the app in development mode, enables fast refresh, and rebuilds pages on change. Default listening port is 3000 unless overridden by environment variables.
-
npm run build— Runsnext build.- What it does: produces a production build for Next.js, compiling pages and assets into the
.nextdirectory. Run this beforenpm run startfor production usage.
- What it does: produces a production build for Next.js, compiling pages and assets into the
-
npm run start— Runsnext start.- What it does: launches the Next.js production server that serves the contents of the
.nextbuild directory. Requires a successfulnpm run buildbeforehand.
- What it does: launches the Next.js production server that serves the contents of the
-
npm run lint— Runseslint ..- What it does: runs ESLint across the repository (the configuration and rules are determined by the repo). Use this to detect and fix lint issues.
Notes:
- Use your preferred package manager. The repository contains a
pnpm-lock.yamlfile; if you use pnpm preferpnpm install. Otherwisenpm ciornpm installwill work for npm users.
Python / Dockermind CLI
The Python package is configured in pyproject.toml. It exposes a console entry point named dockermind (see [project.scripts]). After installing the package, the dockermind command will be available.
Installation (editable/development install):
python -m pip install -e .
What that does: installs the package in editable mode and registers the dockermind CLI entry point. You can then run the CLI from the repository root.
Available CLI commands (usage: dockermind <command> [options]):
-
dockermind init [path] [--compose] [--dry-run] [--force]- What it does: Analyses the project at
path(defaults to.) to detect whether the project is Node.js or Python, determines framework, ports, and build/start steps, then generates a Dockerfile and.dockerignore. If--composeis specified it also generates adocker-compose.yml.--dry-runprints generated files to the console without writing them. Without--force, the command will prompt before overwriting an existing Dockerfile.
- What it does: Analyses the project at
-
dockermind build [path] [--tag <tag>]- What it does: Runs
docker buildusing theDockerfileinpath(defaults to.). The--tag(-t) option sets the image name (defaultdockermind-app). The command streamsdocker buildoutput to the terminal and returns a non-zero exit code on failure.
- What it does: Runs
-
dockermind run [--tag <tag>] [--port <port>] [--detach]- What it does: Runs a Docker container from an image built by
dockermind build. The command maps host port to container port asport:portand runs the container in foreground by default. Use--detach(-d) to run in background. The command checks if the selected port appears in use and warns if so.
- What it does: Runs a Docker container from an image built by
-
dockermind doctor- What it does: Verifies that Docker is installed and that the Docker daemon is running. Also checks for Docker Compose and prints helpful messages and next steps. Returns a non-zero exit code if checks fail.
-
dockermind version- What it does: Prints the installed dockermind package version.
You can also invoke the CLI directly (without installing) with:
python -m dockermind.cli init --dry-run
This runs the init command using the local source tree without installing the package.
Test and helper scripts
-
scripts/run_tests.py— Self-contained smoke tests.- What it does: creates a temporary copy of the
dockermindpackage inside/tmp, imports it and runs a suite of smoke tests that exercise analysis, Dockerfile generation and compose generation for representative Node.js and Python fixtures. The script prints pass/fail results and exits with non-zero status if any tests fail. It is intended as an on-host smoke test and may assume a POSIX environment (it uses/tmp).
- What it does: creates a temporary copy of the
-
scripts/run_tests.sh— Simple shell wrapper for tests.- What it does: installs minimal Python dependencies if needed and then runs the repo test harness under a specific path used by some CI environments.
Notes about tests: the tests in scripts/run_tests.py are not a replacement for a full test suite. They are smoke tests that exercise the core behaviour of the analysis and generation modules.
Docker usage notes
- Generated Dockerfiles attempt to create small, production-ready images. For Node.js projects the generator may use multi-stage builds when a build step is present. For Python projects it will attempt to use
uvicornfor FastAPI projects orflaskfor Flask projects and will add minimal system packages when native dependencies are detected. - The
dockermind runanddockermind buildcommands rely on the local Docker CLI and daemon.
Contributing & Development
- Install Python development dependencies from
pyproject.tomlfor tests and linters (e.g.pytest,ruff,mypy). - Follow the linting and type checks present in the repo. Use
npm run lintfor JavaScript/TypeScript code quality checks.
Developer Contact
- GitHub: https://github.com/Aakashsingh0388
- LinkedIn: https://www.linkedin.com/in/aakash-singh-7b8416318/
If you need further details about the project or help building images, please open an issue on GitHub or contact the developer directly via LinkedIn.
License
This project is provided under the MIT License (see dockermind.egg-info for packaged metadata).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dockermind-0.1.2.tar.gz.
File metadata
- Download URL: dockermind-0.1.2.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07466781f2abc7c64bd3324de0f24e08d77d724151147577b325e38f6f8b422a
|
|
| MD5 |
a67cae2a1b2dad4982025c6dd97a0547
|
|
| BLAKE2b-256 |
4c485f9af5a980428d0a1c87d9cb1a0af11b504e997daea60710b13ff1f20a34
|
File details
Details for the file dockermind-0.1.2-py3-none-any.whl.
File metadata
- Download URL: dockermind-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8c4507a2777e111f2bbd935e803ae3e0ee25cb1c4157ffc5b2ad01de060d7ab
|
|
| MD5 |
2aeb6646a0829bc757168b31e6632d1b
|
|
| BLAKE2b-256 |
38413e5ff290a571b516ef9247d263c966a5f638246a5a789ece67a2b2f5da3c
|