Dhruv Seth — PortfolioSheet 01/01—X 0000 · Y 00000Rev b4dbfbaScale 1:1
dhruvseth.in
  • Home
  • Projects
dhruvseth.in

© 2026 Dhruv Seth · India · Remote

HomeProjectsEmailLinkedIn ↗
Index/Projects/docker-frame-tool
Case study2024

docker-frame-tooldocker-frame-tool

An npx CLI that Dockerizes a Node.js app in one command.

Role
Author & Maintainer
Status
Live
Stack
Node.js logoNode.jsIInquirerDocker logoDockerDocker Compose logoDocker Composenpm logonpm
Links
Live ↗Source ↗
01 · Services02 · PlatformNode.jsInquirerDockerDocker Composenpm
Fig. 01 — System overviewSwipe to explore →
Summary

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.

Measured
Files generated
4
Install
npx · zero setup
npm downloads (12 mo)
140+
Contents
  1. 01The problem
  2. 02How it works
  3. 03What it generates
  4. 04Features
  5. 05Status
  6. 06Links

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:

bash
  1. 1
npx docker-frame-tool
01
Check
Docker installed? package.json present?
02
Ask
Image name, Node version, port, nodemon?
03
Generate
Dockerfile, compose file, .dockerignore
04
Wire up
npm scripts added to package.json
05
Run
npm run docker:run
Fig. — From prompt to running container
  1. Pre-flight checks. It confirms Docker is installed and that the folder has a package.json, with a clear message if either is missing.
  2. 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.
  3. Generated files: a Dockerfile, a docker-compose.yml, a .dockerignore, and Docker scripts added to package.json.

What it generates

A standard Node.js app gets a lean Dockerfile:

dockerfile
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
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:

yaml
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
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:

tty — Scripts added to package.json (nodemon setup)Live
$ npm run docker:build # build the image
$ npm run docker:container # run it, detached
$ npm run docker:run # build and run
$ npm run docker:volume # run with live reloading
$ npm run dev # nodemon, locally
Fig. — Scripts added to package.json (nodemon setup)

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, .dockerignore and 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

  • npm package
  • Source on GitHub

Project links

⌥Source↗↗Live Demo↗

Built with

  • Dhruv Seth
    Dhruv Seth
    Author & Maintainer
    LinkedIn ↗
Next sheet→
ForgeOpsForgeOps

A local-first desktop workspace to design, scaffold and run your services.