docker-frame-tool
An npx CLI that Dockerizes a Node.js app in one command.
- Role
- Author & Maintainer
- Status
- Live
- Stack
Node.jsInquirer
Docker
Docker Compose
npm
docker-frame-tool is a published npm CLI that writes the Docker setup for a Node.js project for you. Run one npx command, answer a few prompts, and it generates the Dockerfile, docker-compose.yml, .dockerignore and ready-to-run npm scripts — with optional nodemon live-reloading inside the container.
- Files generated
- 4
- Install
- npx · zero setup
- npm downloads (12 mo)
- 140+
docker-frame-tool
docker-frame-tool is a command-line tool, published on npm, that automates Docker configuration for Node.js applications. It creates the Dockerfile and Docker Compose file, sets up container ports, image names and run commands, and can wire up nodemon for live reloading inside the container.
The problem
Containerising a Node.js app means writing the same files every time — a Dockerfile, a compose file, a .dockerignore, and a set of build/run commands — and getting the volume mounts right if you want live reloading. It's boilerplate that's easy to get subtly wrong. docker-frame-tool turns it into a short conversation.
How it works
No global install — it runs straight from npm:
npx docker-frame-tool- Pre-flight checks. It confirms Docker is installed and that the folder has a
package.json, with a clear message if either is missing. - A few prompts (built with Inquirer): the image / container name (defaulting to the project folder), the Node.js version, the project type, the port, and whether to mount local files and use nodemon.
- Generated files: a Dockerfile, a
docker-compose.yml, a.dockerignore, and Docker scripts added topackage.json.
What it generates
A standard Node.js app gets a lean Dockerfile:
FROM node:12
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 8080
CMD ["node", "index.js"]With nodemon, the compose file adds a second service that mounts your code into the container — edits on your machine reload the app inside it, while node_modules stays in the container:
container_with_volume:
build:
context: .
image: my-node-app
volumes:
- .:/app
- /app/node_modules
command: ["npm", "run", "dev"]
ports:
- "8080:8080"And the day-to-day commands become npm scripts:
Features
- Zero install — runs with
npx, nothing to set up globally. - Interactive setup — sensible defaults from your project folder.
- Two modes — a plain production-style container, or nodemon with volume-mounted live reloading.
- Complete output — Dockerfile,
docker-compose.yml,.dockerignoreand npm scripts in one pass. - Friendly failures — explains what's missing (Docker,
package.json) instead of crashing.
Status
Published on npm (latest v1.1.1) and open source on GitHub. It currently targets Node.js projects; other project types are on the list.
Links
Project links
Built with
- Dhruv SethAuthor & Maintainer
A local-first desktop workspace to design, scaffold and run your services.